Sign in to follow this  
DEALOS

Setting Max FPS

Recommended Posts

How can I achive that?

EDIT:
I mean that although my program is not complicated and "heavy", it loops so many times a second that it uses all the available CPU making the system run slower.

Share this post


Link to post
Share on other sites
Implement a timer. Under win32, the basic time function is timeGetTime, but it's not very accurate so there's also QueryPerformanceCounter+QueryPerformanceFrequency for high-quality timing.

You'd use these in your main loop to measure how long it's been since the loop last ran. If it's too soon, do something else, like calling Sleep.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this