Hi :)

This is something I find I need quite often, and I usually do something like:

use Time::HiRes qw( time ); # If required my @t; $t[0]= time(); # do some stuff $t[1] = time(); my $diff = formatted_time_diff(@t); print "Processing took $diff seconds\n"; sub formatted_time_diff { return sprintf("%.2f", $_[1]-$_[0]) }

Hope this helps,
Darren


In reply to Re: Compact script for time difference in seconds by McDarren
in thread Compact script for time difference in seconds by vit

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":