Boost logo

Boost :

From: Martin Slater (mslater_at_[hidden])
Date: 2005-02-12 10:53:35

>>> On Fri, 11 Feb 2005 19:30:36 -0500, christopher diggins wrote:
>>> [...]
>>> std::clock() and I assume QueryPerformanceCounter() give you an
>>> amount of
>>> clock ticks. This number is only incremented when the CPU works on
>>> your
>>> task.
>> AFAIK your assumption is wrong.

watch the line wrap. QueryPerformanceCounter uses the CPU clock and is
not per task but system wide.

> Can you point me to documentation which supports your assertion?
>> The only problem with QueryPerformanceCounter() is that it can "jump"
>> on some chipsets.
> I believe this problem is perhaps not restricted to
> QueryPerformanceCounter() but to any counter counting mechanism, as
> the problem is at the chipset level not the API level.

No, there is a very particualar problem relating to
QueryPerformanceCounter() on some (old?) chipsets the can cause it go
backwards in time and wrap after approximately 20 minutes. I reported
this to microsoft some years ago and it was confirmed an issue. (at the
time only happened to me on one particualar celeron / motherboard
configuration). By backwards in time I mean you could call the counter
in a loop and have a reported time earlier than one got the previous
iteration. This bit me on commercial code and I resorted to
instead with no issues.


Boost list run by bdawes at, gregod at, cpdaniel at, john at