At 8:43 PM +0530 12/5/09, Parag Kalra wrote:
Hello All,
I am looking for a simple way to determine the time taken by any Perl
script.
A specific module to determine the time of execution will also do.
After the Perl script gets executed, at the end it should print the time it
took to for the execution.
So just like we execute SQL queries on MySQL and get the time in which the
results were fetched, I am looking for something similar in Perl.
One simple approach would be to store the system at the start and again get
the time at the end. Subtract former from later. Do some calculations,
formatting and get the time of execution.
But is there a simpler way than this?
Check out the Benchmark.pm module, which should be included as part
of your Perl distribution. The documentation for the module has many
suitable examples for timing part or all of your program.
--
Jim Gibson
j...@gibson.org
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/