🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

CPU usage %100

Started by
3 comments, last by knowyourrole 17 years, 3 months ago
hey. did you notice it i don't know but, all of the NeHe's sample codes makes the CPU work at %100. is there a solution for that ?? thanks
Advertisement
That's not a bad thing. With the CPU at 100%, the program is working as fast as it can, which you want a game to do.
when you do something right, people won't be sure you've done anything at all.
you can put a sleep(1) in the main loop, which will drop the CPU usage below 100%, but for a game, you should be using all the CPU power.
thank you :) i didn't know that maximum usage is good. actually i'm a beginner and making small examples, so i would put that sleep(1) for not to have +1000 fps :D which library must i include for sleep ?
You just need <windows.h>, and remember, it's Sleep(), not sleep().

This topic is closed to new replies.

Advertisement