2015-04-30 53 views
1

我可以得到ps命令Linux的更精確的CPU使用率

ps -ax -o pid,rss,pcpu,command 

CPU使用率但也有它打印0.0的過程。我知道原因是因爲價值太小。有沒有什麼辦法(例如ps選項)更精確地打印這些值,如0.002?

+0

看看這個線程,它可以幫助你:[http://stackoverflow.com/questions/14041044/memory-usage-with-high-精] – hkN

+1

我想看看對的/ proc/PID/STAT,[這個答案](http://stackoverflow.com/questions/5514119/accurately-calculating-cpu-utilization-in-linux-using-proc-stat)似乎相關 – bobah

回答