Timer Pause script
Sarah Reichelt
sarah.reichelt at gmail.com
Sat Jul 10 21:02:38 EDT 2010
> After debug, still without see the solution, the time is paused but still
> running... and when I resume after the pause get the whole time.
>
> --reset the startSeconds to the current seconds less the time already on the
> timer.
> put the seconds into tSeconds
> subtract tElapsed from tSeconds
> put tSeconds into startSeconds
>
> Any idea why?
Imagine you start the timer at 3:00:00
After 10 seconds, the time is 3:00:10 and the timer is showing 10 seconds.
Now you pause the timer.
At 3:01:00 you restart the timer.
The original start time is 3:00:00 so if you are still using the
original start time to calculate the elapsed time, the timer will
immediately show 60 seconds when you only want it to show 10 seconds.
Effectively you want to set the start time to 3:00:50 (i.e the current
time - the elapsed time) when you restart at 3:01:00 as that will make
it show the correct elapsed time of 10 seconds.
Cheers,
Sarah
Rodeo discussion:
http://rodeoapps.com/rodeo-discuss-among-yourselves
More information about the use-livecode
mailing list