3 ms·
Win95 had a famous timer wrap at 49.7 days. Ouch. The API call in question is called GetTickCount[1], and it's still really popular - especially for doing quic
by mappu 15y ago
Win95 had a famous timer wrap at 49.7 days. Ouch.
The API call in question is called GetTickCount[1], and it's still really popular - especially for doing quick things like comparing for timeouts, and so forth. It returns milliseconds into a 32-bit int.
There's a replacement named, funnily enough, GetTickCount64, but iirc it's only present on Vista and newer, so it hasn't found its way into a lot of software yet. The Windows Performance counters probably provide better metrics for people actually interested in this data.
_______________________
1. http://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ms72...
- marshray 15y agoI recently had to implement a version of GetTickCount64 for older platforms that only support GetTickCount(32). It works great as long as you remember to call it at least every 49.7 days. :-) (Luckily the process already had a thread which wakes up to perform such maintenance every hour or so.)