Archived

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

DerekDay

Accurate Timing

Recommended Posts

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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites