Hi all,

I found the easiest solution (until now)  for calculating how much time a
script runs.
Thank you for other solutions, but they are too complicated.

Here is the code you should use for calculating the time a script runs:

my $start = (times)[0];

#Here goes the script.

my $end = (times)[0];
my $duration = $end - $start;
print "The script ran for $duration seconds";

This will print the duration in fractions of a second like 1.012, etc.

This method doesn't require any module.

I've used a more simple method a few months ago, but I don't remember it.

I don't understand why (times)[0], but it works.
I've tried putting $times[0] and if I use it only for finding the start
time, it works, but if I use it for the start and the end time, it doesn't
work.

Can you make some light?

Thank you very much.

Teddy Center: http://teddy.fcc.ro/
Mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to