Package io.deephaven.base.clock
Class ClockNanoBase
java.lang.Object
io.deephaven.base.clock.ClockNanoBase
- All Implemented Interfaces:
Clock
A base implementation of Clock, with all methods being sourced from
Clock.currentTimeNanos()
.-
Constructor Details
-
ClockNanoBase
public ClockNanoBase()
-
-
Method Details
-
currentTimeMillis
public final long currentTimeMillis()Description copied from interface:Clock
Milliseconds since the epoch, 1970-01-01T00:00:00Z.The resolution is dependent on the JVM and underlying implementation.
- Specified by:
currentTimeMillis
in interfaceClock
- Returns:
- epoch millis
-
currentTimeMicros
public final long currentTimeMicros()Description copied from interface:Clock
Microseconds since the epoch, 1970-01-01T00:00:00Z.The resolution is dependent on the JVM and underlying implementation. The resolution is greater than or equal to
Clock.currentTimeMillis()
.- Specified by:
currentTimeMicros
in interfaceClock
- Returns:
- epoch microseconds
-
instantNanos
Description copied from interface:Clock
The instant.Has resolution equal to
Clock.currentTimeNanos()
.If you don't need the resolution provided by
Clock.currentTimeNanos()
, preferClock.instantMillis()
.- Specified by:
instantNanos
in interfaceClock
- Returns:
- the instant
-
instantMillis
Description copied from interface:Clock
The instant.Has resolution greater than or equal to
Clock.currentTimeMillis()
.- Specified by:
instantMillis
in interfaceClock
- Returns:
- the instant.
-