0

Hi,
I want to make some kind of monitor for my PC and i want to have CPU load in form like "top" (something% , ex 23%).
So i use C and : i'm opening the file /proc/stat and read the first line :
cpu 92208 2282668 19432 79824 739 1441 3304

the first is user, nice , system ...

So does anyone knows how this things can show me the percentage of CPU usage like "top" does?
thanks

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Belrog
0

It might be easier to just use /proc/loadavg if you only need the cpu load. This matches exactly with 'top'

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.