Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 27th May 2010 04:48
How can i reset the timer?
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 27th May 2010 05:42
You can't. The timer only contains the number of milliseconds that your computer has been on. You can "reset" it by grabbing the timer value at the start of whatever you want to time, and then subtracting that value from each new value of the timer that you get.

Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 28th May 2010 03:10
Im, sry, i didnt got that... how does it works?
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 28th May 2010 04:02 Edited at: 28th May 2010 04:03
The timer() function returns the number of milliseconds your computer has been on. It's just a number that counts up and up and up. If you want to time how long something takes, you can just grab the timer value at the start of the task, and then at the end of the task, subtract the old from the new and then you have the amount of time it took.



Edit: Screwed up the subtraction order. All fixed.

Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 28th May 2010 04:06
For more info on timers: TDK's Timer Tutorial

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 28th May 2010 06:19
Ok, ty

Login to post a reply

Server time is: 2024-09-28 18:16:22
Your offset time is: 2024-09-28 18:16:22