java.lang.Object
org.cybergarage.util.TimerUtil

public final class TimerUtilextends Object
Utility class providing timer and thread sleeping functionality. This class contains static methods for pausing execution and generating random wait times, useful for timing control and thread management.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Both wait helpers are static, so an instance carries nothing.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    static final void
    wait(int waitTime)
    Pauses the current thread for the specified amount of time.
    static final void
    waitRandom(int time)
    Pauses the current thread for a random amount of time up to the specified maximum.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TimerUtil

      public TimerUtil()
      Both wait helpers are static, so an instance carries nothing.
  • Method Details

    • wait

      public static final void wait(int waitTime)
      Pauses the current thread for the specified amount of time.
      Parameters:
      waitTime - the time to wait in milliseconds
    • waitRandom

      public static final void waitRandom(int time)
      Pauses the current thread for a random amount of time up to the specified maximum.
      Parameters:
      time - the maximum time to wait in milliseconds