Hey guys,
QueryPerformanceCounter takes in a LARGE_INTEGER* in which it stores the counter value. I was wondering whether an overflow can occur if the value stored in the LARGE_INTEGER variable is too large? that is if I leave my game open for too long?
I wanted to know how QueryPerformanceCounter worked. Does the counter value increase over time? or is there a mechanism to keep under the maximum value that can be stored in a LARGE_INTEGER?
Thanks
Question about QueryPerformanceCounter
LARGE_INTEGER is a 64bit integer, there's no chance it will overflow from running too long, it will take years to overflow.
[Edited by - marsong on August 10, 2010 1:26:49 PM]
[Edited by - marsong on August 10, 2010 1:26:49 PM]
Well it all depends on what QueryPerformanceFrequency returns. If QPF returns something roughly equal to a modern processor speed (3GHz) and the largest value of LARGE_INTEGER is 2^64 then it will take something like 200 years to roll over.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement