Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 5850 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

Some of you may know the kernel32 function GetTickCount. I''m using this to perform frame rate stuff, but I''ve noticed that it seems to be returning impossible values sometimes. GetTickCount is supoed to return the amount of milliseconds that have passed since windows was booted up... so, what I do in my loop, is calculate how much time (in milliseconds) has passed since the last loop. Nothing complex... but sometimes, I get a time_passed_since_last_loop of 0. Is anyone familiar with this? If not, is there another way to get accurate timing on the windows platform?

Share this post

Link to post
Share on other sites
GetTickCount() isn''t very accurate - I would say it has a range of +/- 5ms accuracy or worse. The following snippet of code should give you a place to start from:

QueryPerformanceFrequency( &Temp );
iClockFrequency = (int)Temp.LowPart;


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!