
QueryPerformanceCounter & hardware
Heyz
i was looking through the "Microsoft''s guide to win95 programming" and i fell over the function QueryPerformanceCounter(). It says that the hardware needs to support "high-resolution performance counting" for the func to work. What hardware supports this and is it standard ?
I need a timer accurate enough to control the pace of my game. is this what im looking for ? if not - what should i use ?
Thanx

My understanding of how QueryPerformanceCounter is implemented:
It uses an undocumented Pentium instruction that gives you the number of cycles since processor startup. Given that and the processor frequency (how they figure that out i dunno, i assume the BIOS knows cuz it displays it at startup), you can get a VERY accurate timing value.
I''m not 100% positive this is how they do it, only 95%.
But the short of it is: if you are planning on running on anything earlier than a Pentium, than QPC might not work. I''ve never had it not work, though.
-vince
It uses an undocumented Pentium instruction that gives you the number of cycles since processor startup. Given that and the processor frequency (how they figure that out i dunno, i assume the BIOS knows cuz it displays it at startup), you can get a VERY accurate timing value.
I''m not 100% positive this is how they do it, only 95%.
But the short of it is: if you are planning on running on anything earlier than a Pentium, than QPC might not work. I''ve never had it not work, though.
-vince
-vince
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement