How to get total cpu usage in Linux using C++
cat /proc/stat http://www.linuxhowtos.org/System/procstat.htm I agree with this answer above. The cpu line in this file gives the total number of “jiffies” your system has spent doing different types of processing. What you need to do is take 2 readings of this file, seperated by whatever interval of time you require. The numbers are increasing values … Read more