Availability of High-Resolution PC Timers

Started by
9 comments, last by core 22 years, 3 months ago
Can anyone give a rough approximation of what percent of PC''s are capable of high-res timers, such as that used by the QueryPerformance* Win32 functions? "If people are good only because they fear punishment and hope for reward, then we are a sorry lot indeed." - Albert Einstein
Advertisement
Just use GetTickCount() it''s pretty accurate.
it''s accurate for most things, but if you want to do some serious debugging then GetTickCount() sucks... I read some whitepapers indicating that GetTickCount() is only accurate to 7-10ms on some system configurations. That aint any use

However, to answer the question, I think everything from the later 386''s onwards have high-frequency timers, failing that, all Pentium (and above) systems do (I''m 99.999999% sure i read that some one)...

I doubt you''ll come across a computer this day-and-age that doesn''t support QueryPerformance*** calls

Jack;

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

I''m pretty sure that all Pentium class proccessors have the high performance timers except some of the early model Cyrix chips. But who uses a Cyrix for games anyway?

----------------------------------
AIM: IanWinsAgain ICQ: 60635592 TIM: FaceHat
FaceHat Software -- Wear the hat.
Thanks a bunch.

GetTickCount = suck
EDIT: Cyrix = suck

"If people are good only because they fear punishment and hope for reward, then we are a sorry lot indeed." - Albert Einstein

Edited by - core on January 15, 2002 6:47:28 PM
GetTickCount() doesn''t suck.

GetTickCount() has almost zero overhead (it just queries a location in memory that is updated by the OS every so often (around 10ms or so)).

QueryPerformanceCounter() is very expensive compared to GetTickCount().

There are also the multimedia timers, using timeBeginTime(), timeGetTime(), and timeEndTime() you can get very accurate timing on just about any computer. Why? Because timeBeginTime() changes the clock frequency (it should also improve the resolution of GetTickCount(), but I don''t remember for sure if that''s the case).

Just choose the correct tool for the job. In most cases, GetTickCount() is perfect.

-Brannon
-Brannon
Using GetTickCount(), you can get 1000 fps, or 100 fps, but nothing in between(10ms accuracy). Likewise, I hear that on certain systems, the frequency on the clock changes to save power, while QueryPerformance*** calls use a method that avoids this.

Z.
______________"Evil is Loud"
Be careful, QueryPerformanceCounter will also jump 20 milliseconds at a time when the OS kicks you off for thread shareing, making it almost unuseable for profiling.
Brannon:
QueryPerformanceCounter() is just the rdtsc instruction so it isn´t expensive (6/13 clock cycles on a PPlain or a PMMX, 31 micro-ops on a PPro,PII or a PIII acording to Agner Fog).

------------------------------------------------------
Cuando miras al abismo el abismo te devuelve la mirada.
F. Nietzsche
Yes Brannon,

You''ve got your counters mixed up, its QueryPerformanceCounter that executes on op on the processor and GetTickCount that has the overhead of a windows function call. However, the previous AP was correct in saying that QueryPerformanceCounter, will jump every few seconds or so.

This topic is closed to new replies.

Advertisement