Package io.helidon.metrics
Interface Clock
-
public interface ClockClock interface to allow replacing system clock with a custom one (e.g. for unit testing).
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description longmilliTime()A millisecond precision current time, such as provided bySystem.currentTimeMillis().longnanoTick()A nanosecond precision tick to use for time measurements.static Clocksystem()Create a clock based on system time.
-
-
-
Method Detail
-
system
static Clock system()
Create a clock based on system time.- Returns:
- clock based on system time
-
nanoTick
long nanoTick()
A nanosecond precision tick to use for time measurements. The value is meaningless, it just must increase correctly during a JVM runtime.- Returns:
- nanosecond value
-
milliTime
long milliTime()
A millisecond precision current time, such as provided bySystem.currentTimeMillis().- Returns:
- current time in milliseconds
-
-