The previous implementation was only using one sample from /proc/stat to compute the current CPU usage. That gave the average CPU usage since system start. The correct way is to use the difference between two samples. This patch does so without needing to spawn a bash process.
The previous implementation was only using one sample from /proc/stat to compute the current CPU usage. That gave the average CPU usage since system start. The correct way is to use the difference between two samples. This patch does so without needing to spawn a bash process.