mathematics ?
# cat /proc/stat cpu 340465 1397 326489 540360 cpu0 340465 1397 326489 540360 page 624282 398572 swap 6368 31892 intr 1998753 1208711 9141 0 0 3 0 0 0 1 0 0 31415 685495 0 63987 0 disk_io: (3,0):(64082,42839,1247940,21243,797124) ctxt 7881082 btime 1128416208 processes 6024 i want to get the percentage CPUfrom this . whats the mathematics ? |
can i get the percentage CPU from this output ?
|
Quote:
Code:
cpu 3357 0 4313 1362393 |
>Percentage CPU of what?
when run "top" command you get CPU states in percent. i want to get similar results without using "top" |
Any particular language?
In C, you can use #include <sys/sysinfo.h> int sysinfo(struct sysinfo *info); which will give you: Code:
struct sysinfo { |
but where is the CPU in percent in your code ?
|
Quote:
|
All times are GMT -5. The time now is 12:05 PM. |