Class SystemTicker

java.lang.Object
io.netty.util.concurrent.SystemTicker
All Implemented Interfaces:
Ticker

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

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final SystemTicker
     
    private static final long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    The initial value used for delay and computations based upon a monotonic time source.
    long
    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

    Methods inherited from interface Ticker

    sleepMillis
  • Field Details

    • INSTANCE

      static final SystemTicker INSTANCE
    • START_TIME

      private static final long START_TIME
  • Constructor Details

    • SystemTicker

      SystemTicker()
  • Method Details

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