Answers for "php ffi get load average"

PHP
0

php ffi get load average

Use this:
<?php
$loads=sys_getloadavg();
$core_nums=trim(shell_exec("grep -P '^physical id' /proc/cpuinfo|wc -l"));
$load=$loads[0]/$core_nums;
echo $load;
?>
Posted by: Guest on October-05-2021

Browse Popular Code Answers by Language