Sign in to follow this  

System Timers are Slowing Down

Recommended Posts

I have some Windows code for a timer that is pretty straight forward. It calls QueryPerformanceFrequency to get the high perf clock freq and then calls QueryPerformanceCounter each frame at the beginning. The code performs a Sleep(1) until a specified amount of time (33 ms) has passed. This is all it does, just sleeps until X ms has passed to force a specific frame rate, I disabled all code running after this. What I'm seeing is that over time, after my PC has been running a while, the QPC return value doesn't change between calls. So I sleep 1 ms, call QPC and the same integer is returned as the previous call before sleeping. I do this repeatedly and then all of the sudden the returned value is a 10 ms or higher jump from the previous value (or any # of ms, 10 just example). I've placed a hysteresis buffer in to be sure that's what is happening. I get the same problem with timeGetTime or getTickCount. It gets worse over time. If I reboot my PC, I get exactly 33.33 ms (30 Hz). I run my PC for a few hours (just my PC, not the software in question), then it's running at 40.5 ms, then a day later at 60.4 ms, etc until just now it was running at 125 ms. Then I rebooted and it went back to 33 ms. The best I can tell, there may be something wrong with my system, the CPU itself, or the motherboard. I have a quad core 2.33 Intel and an EP45-UD3P Gigabyte motherboard. Has anyone ever heard of this before? Thanks! Chris

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this