|
Post by u9 on Feb 18, 2007 20:35:58 GMT -5
Timers.reset seems to restart an already hold'ed timer. I would expect it to actually stop it, but that could be debatable. I don't think it should start a stopped timer but rather set it to zero like what happens when I reset the timer on my watch.
Also, Timers.start only seems to clear a timer. Even if I don't call Timers.start, my timer is still running, which can be confirmed by calling Timer.appTime().
If my timer is not started, then Timer.hold does not stop the timer.
Here are my tests:
timers.initialize t1 = timers.create() t2 = timers.create()
' Test Timers.reset (t1) timers.start t1 system.pause(1000) system.debugPrint round( timers.appTime(t1) ) ' Should be 1 timers.hold t1 system.pause(1000) system.debugPrint round( timers.appTime(t1) ) ' Should still be 1 timers.reset t1 system.pause(1000) system.debugPrint round( timers.appTime(t1) ) ' Should be 0 (because the timer is halted)
' Test without starting the timer (t2) system.debugPrint round( timers.appTime(t2) ) ' Should be 0 (because timer not started) system.pause(1000) timers.hold t2 system.pause(1000) system.debugPrint round( timers.appTime(t2) ) ' Should be 1 second more then previous
|
|
|
Post by Guilect on Feb 19, 2007 8:54:51 GMT -5
Reset now does 2 functions. It puts the time back to zero (same as before) and now also stops a running timer.
A newly created timer shows 0 as its time until started.
|
|