Get cpu percent usage in php

前端 未结 5 1385
生来不讨喜
生来不讨喜 2020-12-16 17:01

I want to show percent CPU usage in PHP. Is not important if get values by cron in shell > output to file > parse in PHP or directly get value in php. I try many solutions f

5条回答
  •  孤城傲影
    2020-12-16 17:53

    you can use "top -n 1" for getting cpu percentage. this command runs top only once, then gives output. i think you can do the parsing part on your own.

提交回复
热议问题