New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High Resolution sleep #439

Closed
Foaly opened this Issue Jul 29, 2013 · 2 comments

Comments

Projects
None yet
3 participants
@Foaly
Contributor

Foaly commented Jul 29, 2013

Implement a high resolution sleep method for threads.
There is a lot of information and also a possible solution in this thread: http://en.sfml-dev.org/forums/index.php?topic=10231.0

@ghost ghost assigned LaurentGomila Jul 29, 2013

@lcdavis13

This comment has been minimized.

Show comment
Hide comment
@lcdavis13

lcdavis13 Aug 11, 2013

The solution on Windows is to use timeBeginPeriod and timeEndPeriod to set the sleep resolution to 1 -- by default it is usually higher, on my machine the default is 16.

Please note that timeBeginPeriod should be called immediately before sleeping and timeEndPeriod should be called immediately after sleeping, as noted in the 'Remarks' section of the Microsoft page. If this is not done correctly it will effect all programs running on the computer and sometimes cause the computer to lag.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd757624(v=vs.85).aspx

lcdavis13 commented Aug 11, 2013

The solution on Windows is to use timeBeginPeriod and timeEndPeriod to set the sleep resolution to 1 -- by default it is usually higher, on my machine the default is 16.

Please note that timeBeginPeriod should be called immediately before sleeping and timeEndPeriod should be called immediately after sleeping, as noted in the 'Remarks' section of the Microsoft page. If this is not done correctly it will effect all programs running on the computer and sometimes cause the computer to lag.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd757624(v=vs.85).aspx

@binary1248 binary1248 referenced this issue Oct 7, 2013

Merged

Timer fix #475

@LaurentGomila

This comment has been minimized.

Show comment
Hide comment
@LaurentGomila

LaurentGomila Oct 7, 2013

Member

Fixed by #475

Member

LaurentGomila commented Oct 7, 2013

Fixed by #475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment