My favorite tool for this is Benchmark::Timer.
use Benchmark::Timer; my $T = new Benchmark::Timer; $T->start( 'Outer' ); for( 1 .. 1000 ) { $T->start( 'Inner' ); # Request a 50 millisec delay to simulate command select undef, undef, undef, 0.05; $T->stop( 'Inner' ) }; $T->stop( 'Outer' ); $T->report; 1 trial of Outer (199.094s total) 1000 trials of Inner (62.500s total), 62.500ms/trial
In reply to Re: Timing a process
by BrowserUk
in thread Timing a process
by ukndoit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |