Advertisement

Accurate Timing

Started by April 05, 2000 08:15 PM
2 comments, last by DerekDay 24 years, 7 months ago
Hey. I need to know if there is a move accurate timer than timeGetTime() that is fairly accessible. If I have to write ASM to access it, then nevermind... I''m just wondering cause I thought I remember either using something different a while back or heard someone talking about this previously. I''ve found that timeGetTime() is good enough if I''m using it to test stuff over 20 - 30ms, but when I get down lower than that, it starts to give me crappy reliability... I''m just fine tuning, so if there isn''t one... oh well. -DerekDay
SetTimer is OK, but then the SetTimer function is totally reliant of the FPS of the program, so i would guess that antoher way to do it would to be to create a seperate thread and do timer stuff there, or is that over-kill?
Advertisement
You can use QueryPerformanceCounter() to get the number of clock cycles that have passed in a given time. If you know the speed of the CPU, you can convert it into (milli)seconds or any other unit of time you wish to use.
Assassin, aka RedBeard. andyc.org
Nevermind... I found the problem... It actually wasn''t related to timeGetTime(). It seems to always happen like that.
-Derek

This topic is closed to new replies.

Advertisement