• ### Popular Now

• 15
• 15
• 11
• 9
• 10

#### Archived

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

# GetTickCount

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

## 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 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:

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

-Mike