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.

Newcomers DBPro Corner / Quick TIMER() question... ; DB-Pro

Author
Message
gbark
19
Years of Service
User Offline
Joined: 14th Oct 2005
Location: US - Virginia
Posted: 31st Jan 2006 22:06
Just wondering here, as the help topics don't explain it...

How does the TIMER() command return milliseconds? IE, does it return how many milliseconds since your computer's been on, or does it record how many milliseconds since mid-night, etc.

Just curious, as I would like to avoid any pitfalls I may encounter when trying to determine elapsed time using the TIMER() function. Thanks!


~ gbark

You can fool some people some of the time, but you can't fool all the people all the time.
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 31st Jan 2006 22:10 Edited at: 31st Jan 2006 22:11
I think it just takes the time (hours:minutes:seconds) in miliseconds.

If you want to have something happen at a steady interval, do something like this


gbark
19
Years of Service
User Offline
Joined: 14th Oct 2005
Location: US - Virginia
Posted: 31st Jan 2006 22:16
Image All,

I has suspected it took it from: (hours:minutes:seconds)

But what if the user runs thatcode around mid-night (like, from 11:59 to 12:02).

Wouldn't:
timer()-Time

Produce in-correct results right as mid-night hit?
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 31st Jan 2006 22:27
Perhapse, but I don't realy know what the timer() function recieves exactly either Either way, it wouldn't crash or anything, just never perform the task again unless


That way it resets Time if the timer minus Time is less than zero, reseting the Time variable also.

gbark
19
Years of Service
User Offline
Joined: 14th Oct 2005
Location: US - Virginia
Posted: 31st Jan 2006 22:37
Alright, thanks for the tips.

I suppose I could do a simple check, like, if timer()-time < 0, add the number of milliseconds in a day (I think 86,400,000??) to even it out, or something like that.


Thanks again!
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 31st Jan 2006 22:47
i always thought the timer measures miliseconds since the program started and just continued going up it shouldnt really matter depending on what ur using it for

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 1st Feb 2006 00:44
It's the milliseconds since the computer has been turned on. I doubt it goes back to zero unless you reboot.


SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 2nd Feb 2006 20:13
Never was sure with this one, DB's help page doesn't actaully say, and the timer function in visual basic returns milliseconds since midnight...

...maybe one day I'll finish a project

Login to post a reply

Server time is: 2024-11-27 05:44:39
Your offset time is: 2024-11-27 05:44:39