Class DummyNanoClock

java.lang.Object
org.apache.logging.log4j.core.util.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 Details

    • 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 Details

    • nanoTime

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