On Fri, 31 Mar 2006 18:50:15 -0700, Bryan Harris wrote: >>> I have a script that takes ~5 seconds to run, but I'd like to get it >>> down to <1 sec. My problem is I don't know which part is the slow >>> part. >> my $start_time = time; >>> (code chunk 1 here) >> print "chunk 1: ", time - $start_time, " seconds\n" >>> >>> -- is there anything I can wrap around the code chunks to see how long >>> each one takes? >> >> It's crude but effective. > > Beautiful, thanks!
I actually wrote http://search.cpan.org/~pjs/Time-TimeTick-0.04/lib/Time/TimeTick.pm for this very purpose. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>