Sleep 5 seconds before returning CPU usage information. This lowers the CPU usage to 3% on my Nexcom.

This commit is contained in:
Scott Ullrich 2005-09-11 21:42:20 +00:00
parent 1bab13d037
commit ba31ab65b2

View File

@ -1,5 +1,6 @@
<?
function cpu_usage() {
sleep(5);
return get_cpuusage(get_cputicks(), get_cputicks());
}
@ -28,6 +29,7 @@ function get_uptime() {
}
function get_cputicks() {
sleep(5);
$cputicks = explode(" ", `/sbin/sysctl -n kern.cp_time`);
return $cputicks;
}