http://qs321.pair.com?node_id=511175


in reply to Re: calculate the time taken to run a script
in thread calculate the time taken to run a script

Perl already keeps track of start time for you in $^T, so unless you're doing something really funky, you can just subtract that from the current time to get elapsed time.

END { my $elapsed_seconds = time - $^T; # Do something with $elapsed_seconds # e.g., print qq(<!-- Script took ${elapsed_seconds}s to run -->); }

    --k.