Event-Lib
view release on metacpan or search on metacpan
scripts/eprof view on Meta::CPAN
#!/usr/bin/perl
use Text::Table;
local @ARGV = shift || "eprof.out";
my (%times, %calls);
while (<>) {
chomp;
my ($func, $msecs) = split;
$times{ $func } += $msecs;
$calls{ $func}++;
}
my $t = Text::Table->new(qw"Function", \" | ", "Calls", \" | ", "Time", \" | ", "Average");
$t->load( map { [ $_, $calls{$_}, $times{$_}, sprintf "%.2f", $times{$_} / $calls{$_} ] }
sort { $times{$b} <=> $times{$a} } keys %times );
print $t->title;
print $t->rule("-", "+");
for ($t->body) {
print;
}
( run in 1.364 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )