java.lang.Object
org.cybergarage.util.TimerUtil
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
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionstatic final voidwait(int waitTime) Pauses the current thread for the specified amount of time.static final voidwaitRandom(int time) Pauses the current thread for a random amount of time up to the specified maximum.
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