Class FakeTicker

    • Constructor Summary

      Constructors 
      Constructor Description
      FakeTicker()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FakeTicker advance​(long nanoseconds)
      Advances the ticker value by nanoseconds.
      FakeTicker advance​(long time, java.util.concurrent.TimeUnit timeUnit)
      Advances the ticker value by time in timeUnit.
      long read()
      Returns the number of nanoseconds elapsed since this ticker's fixed point of reference.
      FakeTicker setAutoIncrementStep​(long autoIncrementStep, java.util.concurrent.TimeUnit timeUnit)
      Sets the increment applied to the ticker whenever it is queried.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FakeTicker

        public FakeTicker()
    • Method Detail

      • advance

        public FakeTicker advance​(long time,
                                  java.util.concurrent.TimeUnit timeUnit)
        Advances the ticker value by time in timeUnit.
      • advance

        public FakeTicker advance​(long nanoseconds)
        Advances the ticker value by nanoseconds.
      • setAutoIncrementStep

        public FakeTicker setAutoIncrementStep​(long autoIncrementStep,
                                               java.util.concurrent.TimeUnit timeUnit)
        Sets the increment applied to the ticker whenever it is queried.

        The default behavior is to auto increment by zero. i.e: The ticker is left unchanged when queried.

      • read

        public long read()
        Description copied from class: Ticker
        Returns the number of nanoseconds elapsed since this ticker's fixed point of reference.
        Specified by:
        read in class Ticker