Class Stopwatch


  • public class Stopwatch
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Stopwatch()
      Creates a new Stopwatch, calls start() automatically.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long elapsed()
      Returns the amount of time since the last call to start() (or this Stopwatch's creation) in milliseconds.
      long elapsed​(java.util.concurrent.TimeUnit units)
      Returns the amount of time since the last call to start() (or this Stopwatch's creation) in the units specified.
      void start()
      Starts the stopwatch.
      • Methods inherited from class java.lang.Object

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

      • Stopwatch

        public Stopwatch()
        Creates a new Stopwatch, calls start() automatically.
    • Method Detail

      • start

        public void start()
        Starts the stopwatch. Subsequent calls to elapsed() will return the time since this call.
      • elapsed

        public long elapsed()
        Returns the amount of time since the last call to start() (or this Stopwatch's creation) in milliseconds.
      • elapsed

        public long elapsed​(java.util.concurrent.TimeUnit units)
        Returns the amount of time since the last call to start() (or this Stopwatch's creation) in the units specified.