Proc::CPUUsage - measures the percentage of CPU the current process is using
my $cpu = Proc::CPUUsage->new; my $usage1 = $cpu->usage; ## returns usage since new() my $usage2 = $cpu->usage; ## returns usage since last usage() ...
This module allows you to measure how much CPU your perl process is using.
The value returned is normalised between 0 and 1, the latter being 100% usage.
$cpu = Proc::CPUUsage->new()
Creates a new Proc::CPUUsage object with the current values for CPU usage.
$usage = $cpu->usage()
The value returned is greater than 0 and lower or equal to 1.
AnyEvent::Monitor::CPU for a more practical use for this module.
<melo at cpan.org>
Copyright 2009 Pedro Melo.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.