Help for this page

Select Code to Download


  1. or download this
    use Win32::SystemInfo::CpuUsage;
    my $intvl = 1000;     # in milliseconds
    my $usage = Win32::SystemInfo::CpuUsage::getCpuUsage($intvl);
    ...
      $usage =        Win32::SystemInfo::CpuUsage::getCpuUsage($intvl);
      print "$i: cpu usage $usage\n";
    }
    
  2. or download this
    1: cpu usage -1
    2: cpu usage -1
    3: cpu usage -1
    4: cpu usage -1
    5: cpu usage -1
    
  3. or download this
    use Sys::Info;
    use Sys::Info::Constants qw( :device_cpu );
    my $Info = Sys::Info->new;
    my $Cpu  = $Info->device( CPU =>%options );
    printf "CPU Load: %s % (last minute)\n", ($Cpu->load(DCPU_LOAD_LAST_01
    +)*100);