ch.aplu.util
Class LoResTimer

java.lang.Object
  extended by ch.aplu.util.BaseTimer
      extended by ch.aplu.util.LoResTimer

public class LoResTimer
extends BaseTimer

Timer with low resolution (based on Date.getTime()) (Resolution normally less than 10 milliseconds.) (All methods (except constructors) call yield() of the current thread unless disabled by special constructor.)


Constructor Summary
LoResTimer()
          Construct a LoResTimer object and set its time to zero.
LoResTimer(boolean autostart)
          Same as LoResTimer(), but the timer starts immediately if autostart is true.
LoResTimer(boolean autostart, boolean yield)
          Same as LoResTimer(autostart), but most methods calls Thread.yield() automatically, if yield is true.
 
Method Summary
 
Methods inherited from class ch.aplu.util.BaseTimer
delay, getTime, isRunning, reset, resume, start, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoResTimer

public LoResTimer()
Construct a LoResTimer object and set its time to zero. The timer must be started by calling start().


LoResTimer

public LoResTimer(boolean autostart)
Same as LoResTimer(), but the timer starts immediately if autostart is true.


LoResTimer

public LoResTimer(boolean autostart,
                  boolean yield)
Same as LoResTimer(autostart), but most methods calls Thread.yield() automatically, if yield is true. This may give a much better time response when using loops with an empty body like

while ( timer.isRunning() ) {}.