- All Superinterfaces:
Wrapper
Reports absolute time (and, therefore, is also useful in computing elapsed times).
-
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the current time in nanoseconds from a monotonic clock source.static Clock
system()
Returns the system clock for the Helidon metrics implementation.default <R> R
Unwraps the clock to the specified type (typically not needed for custom clocks).long
wallTime()
Returns the current wall time in milliseconds since the epoch.
-
Method Details
-
system
Returns the system clock for the Helidon metrics implementation.The system clock methods are functionally equivalent to
System.currentTimeMillis()
andSystem.nanoTime()
.- Returns:
- the system clock
-
wallTime
long wallTime()Returns the current wall time in milliseconds since the epoch.Typically equivalent to
System.currentTimeMillis()
. Should not be used to determine durations. For that usemonotonicTime()
instead.- Returns:
- wall time in milliseconds
-
monotonicTime
long monotonicTime()Returns the current time in nanoseconds from a monotonic clock source.The value is only meaningful when compared with another value returned from this method to determine the elapsed time for an operation. The difference between two samples will have a unit of nanoseconds. The returned value is typically equivalent to
System.nanoTime()
.- Returns:
- monotonic time in nanoseconds
-
unwrap
Unwraps the clock to the specified type (typically not needed for custom clocks).
-