Advertisement

Time Keeping

Started by March 16, 2000 12:21 PM
2 comments, last by UraniumRod 24 years, 7 months ago
Using windows functions is the a more accurate way of measuring the passage of time than GetTickCount()
------------------------------"My sword is like a menacing cloud, but instead of rain, blood will pour in its path." - Sehabeddin, Turkish Military Commander 1438.
Look up Multimedia Timer Functions...those give you precision up to 1 millisecond. timeGetTime()...etc...
Advertisement
Check out QueryPerformanceCounter().
That one''s pretty darn accurate.

*Sparkle*

I use QueryPerformance...() function since it will return values below 1ms. If the above function fails (usually on 486 cpus and below) I use timeGetTime(). I doubt that on 486 and below my rendering will complete below 1ms and if it does I set it to 1ms. But all new cpus will work with the more precise QueryPerformance...(). Then I calculate the time in seconds it took to render my frame and send this value to my drawing functions that tie the animations to a time which I can alter so the animations can play slow or fast.

Cheers

This topic is closed to new replies.

Advertisement