Class SystemTicker

  • All Implemented Interfaces:
    Ticker

    final class SystemTicker
    extends java.lang.Object
    implements Ticker
    • Constructor Summary

      Constructors 
      Constructor Description
      SystemTicker()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long initialNanoTime()
      The initial value used for delay and computations based upon a monotonic time source.
      long nanoTime()
      The time elapsed since initialization of this class in nanoseconds.
      void sleep​(long delay, java.util.concurrent.TimeUnit unit)
      Waits until the given amount of time goes by.
      • Methods inherited from class java.lang.Object

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

      • START_TIME

        private static final long START_TIME
    • Constructor Detail

      • SystemTicker

        SystemTicker()
    • Method Detail

      • initialNanoTime

        public long initialNanoTime()
        Description copied from interface: Ticker
        The initial value used for delay and computations based upon a monotonic time source.
        Specified by:
        initialNanoTime in interface Ticker
        Returns:
        initial value used for delay and computations based upon a monotonic time source.
      • nanoTime

        public long nanoTime()
        Description copied from interface: Ticker
        The time elapsed since initialization of this class in nanoseconds. This may return a negative number just like System.nanoTime().
        Specified by:
        nanoTime in interface Ticker
      • sleep

        public void sleep​(long delay,
                          java.util.concurrent.TimeUnit unit)
                   throws java.lang.InterruptedException
        Description copied from interface: Ticker
        Waits until the given amount of time goes by.
        Specified by:
        sleep in interface Ticker
        Parameters:
        delay - the amount of delay.
        unit - the TimeUnit of delay.
        Throws:
        java.lang.InterruptedException
        See Also:
        Thread.sleep(long)