Package com.landawn.abacus.util
Class Ticker
java.lang.Object
com.landawn.abacus.util.Ticker
Note: Copied from Google Guava under Apache License v2.0
A time source; returns a time value representing the number of nanoseconds elapsed since some fixed but arbitrary point in time. Note that most users should use
A time source; returns a time value representing the number of nanoseconds elapsed since some fixed but arbitrary point in time. Note that most users should use
Stopwatch
instead of
interacting with this class directly.
Warning: this interface can only be used to measure elapsed time, not wall time.
- Since:
- 10.0 (mostly source-compatible since 9.0)
- Author:
- Kevin Bourrillion
-
Method Summary
Modifier and TypeMethodDescriptionabstract long
read()
Returns the number of nanoseconds elapsed since this ticker's fixed point of reference.static Ticker
A ticker that reads the current time usingSystem.nanoTime()
.
-
Method Details
-
read
public abstract long read()Returns the number of nanoseconds elapsed since this ticker's fixed point of reference.- Returns:
-
systemTicker
A ticker that reads the current time usingSystem.nanoTime()
.- Returns:
- Since:
- 10.0
-