http://www.perlmonks.org?node_id=35322


in reply to RE: How can I keep track of the execution time of a script?
in thread How can I keep track of the execution time of a script?

Perhaps you wanted an END block instead of a DIE handler.
END { warn "this script took ", time - $^T, " seconds\n"; }
A die handler is only triggered on aborts. END blocks are triggered on all normal terminations, including aborts.

-- Randal L. Schwartz, Perl hacker