Class 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 Detail

      • Time

        public Time()
    • Method Detail

      • isSimulating

        public static boolean isSimulating()
      • 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)