Win 98 (Gettickcount) is only accurate to 0.05 (The number may be 1.234, but the next number will be 1.274.) (That is 20FPS, if you hit every cycle, and don't pass one. Windows skips calls for gettickcount if you call it too often. Just sends back old buffered data, before it can give you back the real time.)
Win XP is 0.016 per tick (That is 60FPS)
On both, the timer rolls-over after a few days... producing a negative value as the output.
(-Neg - -Neg = -Neg) as opposed to (+Pos - +Pos = +Pos). (New - Old = Diff)
When negative... Old = -4, New = -3, -2, -1, 0, 1, 2, 3...
(-3 - -4 = -1) as opposed to (+3 - +2 = +1)
Use the HighResolutionTimer, it is more accurate to the time, and takes less time for a call.
TimeGetTime is actually better for all computers. It rolls-over but is faster.
The best method would be to do this...
TimeGetTime... and HighResolutionTimer...
Wait for about one minute... Get them again...
Now you can compare real "Time" to the frequency-timer... and adjust instantly. (Keep using HRT for all next calls.)
But less critical things would use TimeGetTime, and adjust for the predictable negative value, as GetTickCount.
Bookmarks