![]() |
|
#1
|
|||
|
|||
CPU UsageHi All,
I have a project in visual syudio.NET in the language C++. Its an MFC application. When i m runnin the application the CPU usage reaches around 100. It should be around 50. How can i rectify this problem? Thanks in advance! Regards Prakhar |
|
#2
|
|||
|
|||
Re: CPU UsageIn my experience code that utilises 100% of the CPU is performing a loop. This may be intentional as in a continuous iteration loop for a game etc, or unintentional.
If your software is supposed to loop then I suggest placing a Sleep() statement in the loop. This will allow the CPU to get on with other things. as an example, my real time simulation uses 100% CPU simply because it is in a constant loop. However, the actual time used to run the simulation is only 2.1 milliseconds. I currently use a Sleep() statement to cool the CPU during development. Note that the minimum resolution of the Sleep() command is 16 milliseconds, and the wake up is a bit jittery. When I use a Sleep() my CPU usage is only 4%.. |
Recent GIDBlog
Observations of Iraq by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CPU Usage | prakhar_jack | MS Visual C++ / MFC Forum | 6 | 08-Feb-2006 00:05 |
| no output, usage of sqrt and pow | micheldenostra | C Programming Language | 3 | 25-Sep-2005 17:32 |
| usage of seekg function | walrus | C++ Forum | 2 | 07-May-2005 15:33 |
| PHP/Apache memory usage issue | bacchus | Apache Web Server Forum | 0 | 18-Aug-2003 12:57 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The