• Advertisement
Sign in to follow this  

lowering the cpu usage fo a program.

This topic is 4758 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