>> 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.  So given
>> something like this:
>> 
>> **************************************
>> #! /usr/bin/perl -w
> 
> my $start_time = time;
>> (code chunk 1 here)
> print "chunk 1: ", time - $start_time, " seconds\n"
>
> $start_time = time;
>> (code chunk 2 here)
> print "chunk 2: ", time - $start_time, " seconds\n"
>
> $start_time = time;
>> (code chunk 3 here)
> print "chunk 3: ", time - $start_time, " seconds\n"
>> **************************************
>> 
>> -- is there anything I can wrap around the code chunks to see how long each
>> one takes?
>> 
>> Thanks!
>> 
>> - Bryan
> 
> It's crude but effective.


Beautiful, thanks!

- B




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to