On Sun, Sep 7, 2008 at 3:44 PM, Melroy <[EMAIL PROTECTED]> wrote:
> Hi all,
> Is there a perl equiavelnt of the unix time command to find out how
> long
> a given process takes to run?
> google search revealed no help. The only thing I found was the times
> command,
> but I don't think it does what I want.
> (Basically I want to find out how long a given process takes to run

I assume you want to find out how long a section of the Perl code takes to run.
You can do something like:

my $startTime = time;
my $retVal = subroutineToBeTimed();
print STDERR "Sub took " . ( time - $startTime ) . " seconds to execute.\n";

For finer measurements, see
http://perldoc.perl.org/perlfaq8.html#How-can-I-measure-time-under-a-second%3f

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


Reply via email to