Archived

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

GetTickCount???

This topic is 6015 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

ya, first test whether QueryPerformanceCounter() works, then if it doesn''t use timeGetTime(), like this:
timeBeginPeriod(1);
time=timeGetTime();
timeEndPeriod(1);
that is more accurate that GetTickCount by far, but it''s not as high res as QPC.

HHSDrum@yahoo.com

Share this post


Link to post
Share on other sites
GetTickCount is for the most part usually okay, but it doesn''t have a very high resolution and you would be way better off using a multimedia timer or a performance timer. What I do is test the system by calling QueryPerformanceFrequency(). If the system has a performance timer, QueryPerformanceFrequency will return 1, and if it doesn''t, it will return 0. Then if there is no performance counter, you can just use timeGetTime(). Of course, using the performance timer requires some extra work since you have to figure out the resolution and adjust your time accordingly, so it may be easier to just always use timeGetTime().

Share this post


Link to post
Share on other sites


It would require very high frame rates to really see a difference between the two timers.

If the framerate is 1.000 fps then a timer with a resolution of 1 ms is clearly not enough...

If it takes you 1 ms or less time to render your frame then you should deffinately use a high performance timer...

If you want to be able to run your game in 10 years when CPUs are 10.000 Mhz and monitors run at 1000hz then use the high performance timer.

It´s very nice to use timeGetTime() because one tick is one ms on all systems. It´s easy for your brain to work with a number like 1.000.

Maybe I am wrong about this...I have used both timers and this is my conclusion....




Share this post


Link to post
Share on other sites
I just use a timer class which looks for the performance timer, and if it isn''t present, uses timegettime. This class converts both to seconds per frame, so my brain has no problems ;-)

Share this post


Link to post
Share on other sites