Jump to content
  • Advertisement
Sign in to follow this  
RuneSword2

Timers

This topic is 4895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm testing my game on some diferent computers but i see that the windows SetTimer run's diferent on diferent computers, the code SetTimer(g_hWnd,103,50,(TIMERPROC) TratarTeclado); runs 16 times/second on a Athlon 64 3200+ but 10 times on a PIII 1000. I don't want to make a thread for every object or event in the game if it's possible, and I don't kwnow if Sleep() has the same problem. Is there any timer with better accuracity?

Share this post


Link to post
Share on other sites
Advertisement
Don't use timers for critical stuff, they are pretty much only used for windows as they allow for a very cheap and effective way to create events without sleeping or having additional threads.

Go timer and if-statements.

Share this post


Link to post
Share on other sites
Sorry I don't know about the windows events well, but i supose that the setTimerEvent may have the same problem ¿no?

I've tried to do my own timer library using the timeGetTime, and I've got these results with 1000 ms

Quote:
Amd Atlon 64 3200+

Started: 21/7/2005 2:35:21,880
Finished: 21/7/2005 2:35:22,880



Quote:
Pentium III 1000

Started: 21/7/2005 2:43:50,286
Finished: 21/7/2005 2:43:51,288


I'm using the system time for this.
Curiously now is the 4:46 not the 2:43
And althought the times seem correct really the Pentiun III spend 3 seconds but the Athlon spends exactly 1 second.

¿What's wrong?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!