Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

core

Availability of High-Resolution PC Timers

This topic is 6001 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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;

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!