A Stopwatch that always returns dur
for the
elapsed duration.
Start the stopwatch.
A function that returns a Long that can be used for measuring elapsed time in microseconds, using the system clock.
A function that returns a Long that can be used for measuring elapsed time in microseconds, using the system clock.
Note that invoking this doesn't entail any allocations.
A function that returns a Long that can be used for measuring elapsed time in milliseconds, using the system clock.
A function that returns a Long that can be used for measuring elapsed time in milliseconds, using the system clock.
Note that invoking this doesn't entail any allocations.
A function that returns a Long that can be used for measuring elapsed time in nanoseconds, using the system clock.
A function that returns a Long that can be used for measuring elapsed time in nanoseconds, using the system clock.
Note that invoking this doesn't entail any allocations.
A function that returns a Long that can be used for measuring elapsed time
in microseconds, that is Time
manipulation compatible.
A function that returns a Long that can be used for measuring elapsed time
in microseconds, that is Time
manipulation compatible.
Useful for testing, but should not be used in production, since it uses a
non-monotonic time under the hood, and entails a few allocations. For
production, see systemMicros
.
A function that returns a Long that can be used for measuring elapsed time
in milliseconds, that is Time
manipulation compatible.
A function that returns a Long that can be used for measuring elapsed time
in milliseconds, that is Time
manipulation compatible.
Useful for testing, but should not be used in production, since it uses a
non-monotonic time under the hood, and entails a few allocations. For
production, see systemMillis
.
A function that returns a Long that can be used for measuring elapsed time
in nanoseconds, that is Time
manipulation compatible.
A function that returns a Long that can be used for measuring elapsed time
in nanoseconds, that is Time
manipulation compatible.
Useful for testing, but should not be used in production, since it uses a
non-monotonic time under the hood, and entails a few allocations. For
production, see systemNanos
.
The system Stopwatch measures elapsed time using
System.nanoTime
.Note that it works well with unit tests by respecting time manipulation on Time.
Stopwatches for Java APIs.