Laptop timer issue

Started by spasi, June 19, 2004, 21:03:55

Previous topic - Next topic

spasi

My brother bought a laptop last month and he's seeing some strange timing issues with certain games. The cpu is a Pentium M 1.6GHz, that downclocks to ~550MHz when "just working" in Windows. The problem is that when starting a game, the cpu isn't immediately back up to 1.6GHz. It seems that these certain games, read the hi-res timer resolution at that time (when the cpu frequency is still low) and that results in these games running faster (their animations) than they should (~3 times).

I'm wondering if anyone has encountered such a problem and what they did to solve it (just call getTimerRes every time, "refresh" the resolution every few seconds).

I guess we'll soon see auto-downclocking in desktop cpus soon, so this may become a general issue.

PS: Am I right to assume that the hi-res timer resolution is dependent on the cpu frequency?

fenix

I encountered this problem only in Ubisoft games (Splinter Cell 2 & Prince of Persia), I load the game and everything is running faster than normal. When I quit the game and reload fast enough everything runs as it should.
postolos Tsakpinis
zDimensions

princec

Ahhh. That explains why one one my minions at work always has to play Trials Pro at 2x its normal rate the first time he plays. It's not limited to laptops I don't think.

The correct approach is to periodically refresh the timer resolution.

Cas :)

oNyx

Mh... how annyoing. But it's good to know that pitfall.

princec

We should get that documented. I'll probably update the org.lwjgl.util.Timer class too so that it automatically refreshes its resolution every minute.

Cas :)

spasi

It would be nice if the refresh interval (the 1 minute you mentioned) could be set from the api.

princec

Nice but probably pointless :) Maybe every 5 seconds is fine. We are, after all, talking about a JNI call that takes 300nanos to execute.

Cas :)