Jump to content
  • Advertisement

Archived

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

Lythic

GetTickCount

This topic is 5934 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
Advertisement
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:


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


-Mike

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.

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!