Returns the current elapsed time shown on this stopwatch, expressed in milliseconds, with any fraction rounded down.
Returns the current elapsed time shown on this stopwatch, expressed
in milliseconds, with any fraction rounded down. This is identical to
elapsedTime(TimeUnit.MILLISECONDS
.
Returns the current elapsed time shown on this stopwatch, expressed in the desired time unit, with any fraction rounded down.
Returns the current elapsed time shown on this stopwatch, expressed in the desired time unit, with any fraction rounded down.
Note that the overhead of measurement can be more than a microsecond, so it is generally not
useful to specify TimeUnit#NANOSECONDS
precision here.
Sets the elapsed time for this stopwatch to zero, and places it in a stopped state.
Sets the elapsed time for this stopwatch to zero, and places it in a stopped state.
this Stopwatch
instance
Starts the stopwatch.
Starts the stopwatch.
this Stopwatch
instance
IllegalStateException
if the stopwatch is already running.
Stops the stopwatch.
Stops the stopwatch. Future reads will return the fixed duration that had elapsed up to this point.
this Stopwatch
instance
IllegalStateException
if the stopwatch is already stopped.
Returns a string representation of the current elapsed time; equivalent to toString(4)
(four significant figures).
Returns a string representation of the current elapsed time; equivalent to toString(4)
(four significant figures).
Simple Stopwatch
3.0.0