That means loading yet another non-core module. Why not use Time::HiRes instead, which is core.
On a second note, IF you want to make this into a module, consider finding a way to accept options for what to print on start and exit. It might be very interesting to add an option that uses the values returned by times () to show resource use. It's a shame that there is no HiRes version for this function, but you might want to delve into getrusage () in BSD::Resource (which may not work on non-Unix boxes).
If options like that were implemented correctly, it would certainly be worth releasing to CPAN.
test.pl started : Fri Aug 13 08:23:10 2010
test.pl ended : Fri Aug 13 08:23:11 2010
duration: 00:00:01.51003 (usr: 0.41, sys: 0.19, cusr: 0, csys:
+ 0)
update: being able to select the output (STDOUT or STDERR) would be another point of attention
Enjoy, Have FUN! H.Merijn
|