Class DeltaClockWithAdjustableSpeed

java.lang.Object
io.deephaven.enterprise.replay.DeltaClockWithAdjustableSpeed
All Implemented Interfaces:
Clock

public final class DeltaClockWithAdjustableSpeed extends Object implements Clock
A clock impl with a delta adjustment and a speed factor.

The speed can be changed on the fly, which is a nifty trick for demos.

  • Constructor Details

    • DeltaClockWithAdjustableSpeed

      public DeltaClockWithAdjustableSpeed(@NotNull @NotNull Clock delegate, long deltaNanos, double speedFactor)
      Constructs a delta clock with the provided clock and delta.
      Parameters:
      delegate - the base clock
      deltaNanos - the delta nanos
  • Method Details

    • setSpeedFactor

      public void setSpeedFactor(double newFactor)
    • getSpeedFactor

      public double getSpeedFactor()
    • currentTimeMillis

      public long currentTimeMillis()
      Specified by:
      currentTimeMillis in interface Clock
    • currentTimeMicros

      public long currentTimeMicros()
      Specified by:
      currentTimeMicros in interface Clock
    • currentTimeNanos

      public long currentTimeNanos()
      Specified by:
      currentTimeNanos in interface Clock
    • instantNanos

      public Instant instantNanos()
      Specified by:
      instantNanos in interface Clock
    • instantMillis

      public Instant instantMillis()
      Specified by:
      instantMillis in interface Clock