[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Time taken by a script



Ahoy

You ask:


> I've written a cgi script in perl an I would like to know how long
> (exactly, 10th of second) it takes to execute the script, how can I do
> this?

Here's a crude way:

#!/usr/bin/perl

$now = time();

for( i=0; i<10; i++) {
  require("thescriptIwanttotime.pl");
}

$then = time();

$elapsed = (($then - $now) / 10);

print $elapsed;

exit;

Aloha
Davis





Reply to: