Jump to content
  • Advertisement
Sign in to follow this  
mark ds

timeBeginPeriod under Windows 8.1 is always 15ms using GetTickCount?

This topic is 2140 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 was playing around with some code earlier, and I noticed that whatever value I use for timeBeginPeriod, the OS seems to ignore it, and always use 15ms increments for GetTickCount, but honours it for timeGetTime. Under Windows 7, timeBeginPeriod applied to both GetTickCount and timeGetTime

 

It's *probably* the same using Win8, but I can't test it.

 

Can anyone else confirm this behaviour?

Share this post


Link to post
Share on other sites
Advertisement

IIRC this function used to change the timing behaviour of the whole system. Maybe they changed its behaviour in windows 8...

I guess you'd be better off using QueryPerformanceCounter and QueryPerformanceFrequency

Share this post


Link to post
Share on other sites

Yeah, it's no big deal, I just used to set the system timer to 1ms for quick and dirty profiling - but was pretty surprised that timeGetTime and GetTickCount are no longer synchronised.

 

I guess the thinking behind it is that 1ms timers are not particularly battery friendly.

 

I wonder how many application/games will break because of this change? I know it's a poor way to code, but I bet there's hundreds of apps that do it this way to sync frame rates etc.

Share this post


Link to post
Share on other sites

this issue could be related to the RTC "bug" under intel platform and Windows 8/8.1...You can try to fix it by typing in the terminal as admin the following line:

 

bcdedit /set useplatformclock Yes

 

and reboot the system.

 

As Madhed (and even Microsoft) suggests, it's better to use the QPC timer intead of GetTickCount for performance applications (GetTickCount is still good for low priority and background operations), since it should use the highest resolution timer available to the platform (usually HPET or DMI  frequency).

Edited by Alessio1989

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!