Sunday, January 10, 2010

How to calculate the time of execution of a Perl script

Just add the following line any where in your Perl script and it will print its time of execution right at the end:

# This calculates the time of execution of the Perl script.
END {warn "\nTime of execution - ", time - $^T, " second(s)\n"}

No comments: