Class Time

java.lang.Object
org.apache.storm.utils.Time

public class Time extends Object
This class implements time simulation support. When time simulation is enabled, methods on this class will use fixed time. When time simulation is disabled, methods will pass through to relevant java.lang.System/java.lang.Thread calls. Methods using units higher than nanoseconds will pass through to System.currentTimeMillis(). Methods supporting nanoseconds will pass through to System.nanoTime().
  • Constructor Details

    • Time

      public Time()
  • Method Details

    • isSimulating

      public static boolean isSimulating()
    • sleepUntil

      public static void sleepUntil(long targetTimeMs) throws InterruptedException
      Throws:
      InterruptedException
    • sleepUntilNanos

      public static void sleepUntilNanos(long targetTimeNanos) throws InterruptedException
      Throws:
      InterruptedException
    • sleep

      public static void sleep(long ms) throws InterruptedException
      Throws:
      InterruptedException
    • parkNanos

      public static void parkNanos(long nanos) throws InterruptedException
      Throws:
      InterruptedException
    • sleepSecs

      public static void sleepSecs(long secs) throws InterruptedException
      Throws:
      InterruptedException
    • nanoTime

      public static long nanoTime()
    • currentTimeMillis

      public static long currentTimeMillis()
    • nanosToMillis

      public static long nanosToMillis(long nanos)
    • millisToNanos

      public static long millisToNanos(long millis)
    • secsToMillis

      public static long secsToMillis(int secs)
    • secsToMillisLong

      public static long secsToMillisLong(double secs)
    • currentTimeSecs

      public static int currentTimeSecs()
    • deltaSecs

      public static int deltaSecs(int timeInSeconds)
    • deltaMs

      public static long deltaMs(long timeInMilliseconds)
    • advanceTime

      public static void advanceTime(long ms)
    • advanceTimeNanos

      public static void advanceTimeNanos(long nanos)
    • advanceTimeSecs

      public static void advanceTimeSecs(long secs)
    • isThreadWaiting

      public static boolean isThreadWaiting(Thread t)