/proc/stat
1 | cat /proc/stat | grep "cpu " | \ |
/proc/<pid>/stat
1 | cat /proc/<pid>/stat | awk '{printf "%d\n", $14 + $15 + $16 + $17}' |
$$
\mathrm{cpu\ utilization} = \frac{c2 - c1}{t2 - t1}
$$
1 | cat /proc/stat | grep "cpu " | \ |
1 | cat /proc/<pid>/stat | awk '{printf "%d\n", $14 + $15 + $16 + $17}' |
$$
\mathrm{cpu\ utilization} = \frac{c2 - c1}{t2 - t1}
$$
微信支付
支付宝