public interface MicrosClock
MicrosClock provides a mechanism for tracking time with microsecond
standard millisecond-precision clocks, this interface ensures finer time
granularity, which is useful for high-resolution time measurements, event
sequencing, and performance monitoring.
Implementations of this interface should provide a consistent and efficient method for retrieving the current epoch time in microseconds.
| Modifier and Type | Method and Description |
|---|---|
default long |
currentTimeMicros()
Returns the current time in microseconds since the UNIX epoch (January 1,
1970, 00:00:00 UTC).
|
long |
epochMicros()
Returns the current time in microseconds since the UNIX epoch (January 1,
1970, 00:00:00 UTC).
|
long epochMicros()
Implementations must ensure that the returned value is a strictly increasing timestamp with a resolution of at least one microsecond.
default long currentTimeMicros()
Implementations must ensure that the returned value is a strictly increasing timestamp with a resolution of at least one microsecond.