Skip to main content
gamedev.net
🔒 Locked

Restricting CPU Usage

Started by Telamon Mar 29, 2004 at 10:20 PM 0 replies 300+ views
Original Post
Telamon
Telamon
Hi, I''m writing a CPU-hungry simulation in C# and I''d like to add a slider bar that lets the user adjust how much of the CPU the simulation can use. So for example I could set it to 60% and never have my program''s CPU usage go above 60%. I''ve noticed that other simulation programs (like folding@home) have this option. How can I accomplish this? Is it an API call? Or do I have to have my program constantly monitor it''s usage and Sleep() when it is too high? ---------------------------------------- Let be be finale of seem, seems to me. ---------------------------------------- Coding: http://www.stanford.edu/~jjshed/coding Miscellany: http://www.stanford.edu/~jjshed
Shannon Barber
Shannon Barber
Probably sleep x after y milliseconds.
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.