ElapsedMilliseconds/GetTickCount wrap
Posted: Mon Dec 15, 2008 9:38 pm
Hi guys. One of my apps makes extensive use of ElapsedMilliseconds(),
which is a wrapper the GetTickCount_() API. But, as you might know,
it's a 16-bit value which becomes negative after 49.7 days.
At my workplace, our PCs are on 24/7. So now, these commands return
a negative value for me, making them useless. How can I truly know how
long the PC has been on, in milliseconds? The Win32.hlp file says:
which is a wrapper the GetTickCount_() API. But, as you might know,
it's a 16-bit value which becomes negative after 49.7 days.
At my workplace, our PCs are on 24/7. So now, these commands return
a negative value for me, making them useless. How can I truly know how
long the PC has been on, in milliseconds? The Win32.hlp file says:
But I have no idea where this is in the Registry (can't find it). Any ideas?Win32.hlp wrote:Windows NT: To obtain the time elapsed since the computer was started, look up the System Up Time counter in the performance data in the registry key HKEY_PERFORMANCE_DATA. The value returned is an 8 byte value.