Jump to content
  • Advertisement
Sign in to follow this  
crazy_andy

lowering the cpu usage fo a program.

This topic is 4970 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 have a c++ program that runs in the background, and it has a continuouse loop in it. However it has a cpu usage of 99% I need to check the current time approximatly every 20 seconds. How can I pause the program for this 20 secconds and then loop once and pause again etc... I need the cpu to get no higher than 2-3% really.

Share this post


Link to post
Share on other sites
Advertisement
Also what platform if windows, console or Win32? If you use Win32, you can actually create a timer that fires every 20 seconds, of which you can place your code to execute in there. If you have a console app, you could add in your own windows messaging loop and do the same as well.

- Drew

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!