gettimeofday ()
In the context of an array, it returns a two-element array with seconds and microseconds since the beginning of the epoch. In scalar context, returns seconds (floating point) as Time :: HiRes :: time ()
tv_interval ($ ref_to_gettimeofday [, $ ref_to_later_gettimeofday])
Returns seconds seconds (float) between two values that should have been returned by gettimeofday (). If the second argument is omitted, the current time is used. documentation
use Time::HiRes qw(gettimeofday tv_interval); my $startTime = [ gettimeofday ]; # some actions my $endTime = [ gettimeofday ]; my $elapsed = tv_interval($startTime,$endTime); print "TIME: $elapsed\n";
Time::HiRes::time- nörbörnën 1:27 pm