Class DummyNanoClock

  • All Implemented Interfaces:
    NanoClock

    public final class DummyNanoClock
    extends Object
    implements NanoClock
    Implementation of the NanoClock interface that always returns a fixed value.
    • Constructor Detail

      • DummyNanoClock

        public DummyNanoClock()
      • DummyNanoClock

        public DummyNanoClock​(long fixedNanoTime)
        Constructs a new DummyNanoClock with the specified value to return.
        Parameters:
        fixedNanoTime - the value to return from nanoTime().
    • Method Detail

      • nanoTime

        public long nanoTime()
        Returns the constructor value.
        Specified by:
        nanoTime in interface NanoClock
        Returns:
        the constructor value