Class ContinuousStopwatch


  • @NotThreadSafe
    public final class ContinuousStopwatch
    extends java.lang.Object
    A continuously timing stopwatch that is used for simple performance monitoring.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.logging.Logger logger  
      private com.google.common.base.Stopwatch stopwatch  
    • Constructor Summary

      Constructors 
      Constructor Description
      ContinuousStopwatch​(com.google.common.base.Stopwatch stopwatch)
      Constructs a ContinuousStopwatch, which will start timing immediately after construction.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long reset()
      Resets and returns elapsed time in milliseconds.
      void resetAndLog​(java.lang.String label)
      Resets and logs elapsed time in milliseconds.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private final java.util.logging.Logger logger
      • stopwatch

        private final com.google.common.base.Stopwatch stopwatch
    • Constructor Detail

      • ContinuousStopwatch

        public ContinuousStopwatch​(com.google.common.base.Stopwatch stopwatch)
        Constructs a ContinuousStopwatch, which will start timing immediately after construction.
        Parameters:
        stopwatch - the internal stopwatch used by ContinuousStopwatch
    • Method Detail

      • reset

        public long reset()
        Resets and returns elapsed time in milliseconds.
      • resetAndLog

        public void resetAndLog​(java.lang.String label)
        Resets and logs elapsed time in milliseconds.