use Benchmark::Timer; $t = Benchmark::Timer->new(skip => 1); foreach my $field (sort @$field_order) { $t->start('tag'); print "\t\n"; print "\t\t$field :\n"; for my $i (0 .. $num_recs) { print "\t\t$records->[$i]->{$field}\n"; } print "\t\n"; $t->stop; } $t->report; #### $ perl -MDevel::Profiler your_script.pl #### $ dprofpp #### # in httpd.conf PerlModule Devel::Profiler::Apache; # or in startup.pl use Devel::Profiler::Apache;