Re: High resolution timer.
- From: Hendrik van der Heijden <spamtrap@xxxxxxxxxx>
- Date: Mon, 16 Jun 2008 08:18:16 +0200
Tim Roberts schrieb:
Hendrik van der Heijden <spamtrap@xxxxxxxxxx> wrote:Sergey.skv schrieb:I need to implement low cost high resolution timer (on a scale ofUse QueryPerformanceCounter / QueryPerformanceFrequency
1ms) . It should run on Windows and Linux so there is no Win32 API.
The first thing to use is RDTSC. Every body express concern about CPU
throttling. What about multiple CPUs. Does RDTSC return the same
number for different CPUs?
on Windows and gettimeofday on Linux.
Those are independent of CPU cores and clock changes.
Unfortunately, that's not true. On a multiprocessor machine,
QueryPerformanceCounter returns the raw cycle counter. The returned value
can even go backwards if you switch CPUs.
Afaik, the idea is that QueryPerformanceCounter should not have
the problems of RDTSC with core migration and changing clok frequency.
However, there were patches from MS (KB896256) and AMD to get
the intended behaviour right on multicore/MP systems.
Hendrik vdH
.
- Follow-Ups:
- Re: High resolution timer.
- From: Tim Roberts
- Re: High resolution timer.
- References:
- High resolution timer.
- From: Sergey . skv
- Re: High resolution timer.
- From: Hendrik van der Heijden
- Re: High resolution timer.
- From: Tim Roberts
- High resolution timer.
- Prev by Date: Re: High resolution timer.
- Next by Date: Get the FAQs
- Previous by thread: Re: High resolution timer.
- Next by thread: Re: High resolution timer.
- Index(es):
Relevant Pages
|