in reply to
How to Monitor System Resources
Check out Sys::Info, it's a great little module and it is cross-platform. This code is directly from the POD documentation, except the call to $info->device requires just 'CPU', not CPU => %options.
use Sys::Info::Constants qw( :device_cpu );
my $info = Sys::Info->new;
my $cpu = $info->device('CPU');
printf "CPU: %s\n", scalar($cpu->identify) || 'N/A';
printf "CPU speed is %s MHz\n", $cpu->speed || 'N/A';
printf "There are %d CPUs\n" , $cpu->count || 1;
printf "CPU load: %s\n" , $cpu->load || 0;
This prints on my linux box:
CPU: 2 x Intel(R) Pentium(R) 4 CPU 2.80GHz
CPU speed is 2801.015 MHz
There are 2 CPUs
CPU load: 0.21
It should run on my windows box, but I found out with ActivePerl 5,the latest version was 0.51 as PPMs tend to lag, and I'm not sure how to install a module with XS code from CPAN on Windows.