Sign in to follow this  
DeadXorAlive

broken timer values workaround

Recommended Posts

I use the timer from GLFW, which I guess on Windows is QueryPerformanceCounter although I'm not sure. Once in a while, it gives totally wrong values. After googling I suspect it is because i have AMD cool 'n quiet installed, which can change cpu frequency and thus mess with the timer. There are similar issues on Intel speedstep and dual-core processors: some random thread about this. I've found the RDTSC asm instruction which I could use with inline assembler, but I think it will suffer the same issues. Do you know a good workaround and what are the caveats? Should I use a different, less accurate timer or measure some average, and when the timestep deviates too much from it ignore it or something like that?

Share this post


Link to post
Share on other sites
Thank you for the information. Reading the article and the thread I linked to better, it seems that QueryPerformanceCounter reads the actual frequency of the core with cool 'n quiet, while QueryPerformanceFrequency still gives the same (incorrect) value.
There is a hotfix for XP, haven't tried it but thought I would mentioned it here anyway. It is said Vista will fix this.

I will go for the clamping and try averaging if clamping doesn't work out.


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