Re: QueryPerformanceFrequency
- From: Ondrej Spanel <OndrejSpanel.news@xxxxxxxxxxxxx>
- Date: Wed, 19 Mar 2008 15:53:04 +0100
While rdtsc is one possible implementation, on some CPUs/systems the QPC needs to be implemented in a more complex manner (multiple CPUs, CPUs with adaptive frequency, like seen first in notebooks and now in most systems...)
I would definitely not recommend using rdtsc directly - it was quite a common practice in game programming to do this a few years back, and games which did it are experiencing serious compatibility issues recently.
Even on CPU with no rdtsc instruction was introduced, the QPC was implemented on most systems, usualy using some motherboard high frequency counter (like 4 MHz).
Ondrej
Alex Blekhman napsal(a):
"David Webber" wrote:.The topic "About timers" in the documentation says:
"If a high-resolution performance counter exists on the system, you can use the QueryPerformanceFrequency function to express the frequency, in counts per second"
The "if" is a bit worrying: am I likely to encounter systems on which there isn't one?
A high-resolution performance counter is an euphemism for RDTSC CPU instruction. It was introduced with Intel's Pentium processors.
Alex
- Follow-Ups:
- Re: QueryPerformanceFrequency
- From: Tim Roberts
- Re: QueryPerformanceFrequency
- From: Alex Blekhman
- Re: QueryPerformanceFrequency
- References:
- Re: QueryPerformanceFrequency
- From: Alex Blekhman
- Re: QueryPerformanceFrequency
- Prev by Date: Re: call base class function or derived class function
- Next by Date: Re: HTTPClient library
- Previous by thread: Re: QueryPerformanceFrequency
- Next by thread: Re: QueryPerformanceFrequency
- Index(es):
Relevant Pages
|