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.

Bug Reports / [C++] DarkGDK dbTimer() overflow

Author
Message
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 3rd Apr 2012 19:42
If the computer is left on too long, then dbTimer() overflows to negative values! dbPerformanceTimer() should stop that (it returns a LONGLONG rather than an int), but it isn't declared!

On a related note, can anyone post the code for dbTimer() so that I can make my own function that returns a long integer?
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 4th Apr 2012 03:09 Edited at: 4th Apr 2012 03:13
The dbTimer function just call's the Window's API function (winmm.dll) timeGetTime.
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 5th Apr 2012 12:48
I see, and according to MSDN, it resets back to zero every 49 days without reboot. The windows function must therefore return an unsigned integer, but dbTimer() returns a signed one which resets every 24 days. It's only very extreme circumstances that it would reset!
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 6th Apr 2012 00:38
Here are two excerpts from the Windows SDK help files for timeGetTime and QueryPerformanceCounter API functions.

timeGetTime


QueryPerformanceCounter
Monosultap
11
Years of Service
User Offline
Joined: 25th Apr 2012
Location:
Posted: 26th Apr 2012 05:27

Login to post a reply

Server time is: 2024-04-19 11:05:02
Your offset time is: 2024-04-19 11:05:02