cpu core utilization
Can anyone explain the way that I can get the current cpu core utilization for each cpu core in multi core machine pragmatically(In C )...
|
A method is:
1. open /proc/stat 2. read in the idle (and perhaps iowait) times for each processor (see man /proc for a description of the format) 3. wait one second 4. read in the idle times again 5. find the differences and divide by the tick frequency This will give you the idle fraction for each cpu over the last second. |
All times are GMT -5. The time now is 03:26 PM. |