HighPerformanceCounter rounding

nobody_ spam at spam.spam
Wed Oct 25 11:34:36 PDT 2006

Thanks for the reply.

>> It's probably because of the sleep function, this can be off by about 10 
>> to 16 ms usually on windows, iirc.

I think so too, except that the usleep is never off by more than 2ms here ;)
My program will only be run on one computer, which makes it alot easier, but 
I already decided to let my AD card determine the rate.

>> Beware that sometimes QueryPerformanceCounter, which 
>> HighPerformanceCounter uses, can behave erratically on dualcore systems 
>> and systems with variabele clock speeds (Intel's Speed Step, AMD's cool 
>> 'n quiet).

I've been reading through the msdn:
As I read it QPC takes care of multicore etc. (I only care about winxp 
directx9 :)
Only if QPC determines that the RDTSC is a stable counter will it use that 
Otherwise it searches for a better source (mainboard counter chips etc).
What I do miss is the QueryPerformanceFrequency to check the granularity or 
did I just miss it somewhere?

More information about the Digitalmars-d-learn mailing list