Class MonotonicClock

java.lang.Object
java.time.Clock
com.eqixiac.equinix.core.internal.MonotonicClock
All Implemented Interfaces:
InstantSource

public final class MonotonicClock extends Clock
A Clock whose millis() advances with System.nanoTime(): it is monotonic, so a wall-clock adjustment (NTP step, DST, a manual change) can neither shorten nor extend an elapsed-time measurement. It is the default time source of the SDK's elapsed-time logic (for example CircuitBreaker cooldowns); tests substitute a controllable Clock instead of sleeping.

The instant it reports is anchored to the wall clock once, at class initialisation, so it is only meaningful for measuring durations, not as a calendar time.

Author:
ianjones