Class ClockNanoBase

java.lang.Object
io.deephaven.base.clock.ClockNanoBase
All Implemented Interfaces:
Clock

public abstract class ClockNanoBase extends Object implements 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 interface Clock
      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 interface Clock
      Returns:
      epoch microseconds
    • instantNanos

      public final Instant 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(), prefer Clock.instantMillis().

      Specified by:
      instantNanos in interface Clock
      Returns:
      the instant
    • instantMillis

      public final Instant instantMillis()
      Description copied from interface: Clock
      The instant.

      Has resolution greater than or equal to Clock.currentTimeMillis().

      Specified by:
      instantMillis in interface Clock
      Returns:
      the instant.