|
|||||||||||||||||||||||||||
sub read_top {
my @toplist;
my $total = 0;
@toplist = `ps -eo pcpu,user,time`; while(@toplist) {
$_=shift(@toplist);
if (/([\d\.]+)\s+(\w+)\s+([\d\.\-:])/) {
$total += $1;
} }
return($total);
}
|
||||||||||||||
|
||||||||||||||