failed timeBeginPeriod (api, winmm.dll)

Started by
2 comments, last by SquareDanceSteve 16 years, 10 months ago
timeBeginPeriod affects no change on my laptop's timing precision, does any one know the cause or how to fix it?
-----------------www.stevemata.com
Advertisement
What exactly are you trying to do? The timeBeginPeriod function is limited to the timing precision of the hardware. Check the return value for TIMERR_NOCANDO.

Skizz
How do you know that it doesn't change anything? How did you test it? What was the precision without timeBeginPeriod?

A lot of systems run run timeGetTime with a 1ms precision even without timeBeginPeriod. And since that function sets the precision to 1ms, it's easy to see how it won't change anything. [wink]

Generally, if you need better precision than that, use QueryPerformanceCounter instead.
I made a second window for my game that tracks performance. One of the things it tracks is the time elapsed between frames. It usually returns 16ms or 32ms and sometimes 48ms, that's very poor. 16ms is only 62 frames a second and 32ms is only 31 frames per second. That's poor precision, alternating between 16ms and 32ms forces animation speed's to vary frame by frame.

I tested first by setting the ms precision to 1ms. It continued reporting 16 and 32. I then set the precision to 48 and the graph continued to report 16 and 32.
-----------------www.stevemata.com

This topic is closed to new replies.

Advertisement