Sign in to follow this  

cpu hog!

This topic is 3625 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 simply wondering how do I prevent my program from becoming a cpu hog? I am using the PeekMessage method and I cannot switch to get without irritating anyone who wants to use my program. Is there a way to just limit the program to update only 30fps? Thanks for the help

Share this post


Link to post
Share on other sites
Well, if your app is running in the foreground, it's perfectly acceptable to use 100% of the CPU. If nothing else is using the CPU, there's no problem. You could also change your process priority if you want to, but I don't think it's really worthwhile.

In my engine, I just do a busy loop with PeekMessage(), then Render() after all messages have been processed for a frame, and if the app gets minimised, it switches to GetMessage() and no rendering.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
You could also change your process priority if you want to, but I don't think it's really worthwhile.
I agree. I also tried this and found no real advantage. Today' scheduler is pretty smart even without those hints.

Share this post


Link to post
Share on other sites

This topic is 3625 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.

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