#! perl -w use Time::HiRes qw(gettimeofday); use Time::HiRes qw(sleep); # for this demo only my @t = scalar gettimeofday; sleep 3.1415926; push @t, scalar gettimeofday; printf "Total time wasted: %.3f seconds\n", $t[-1]-$t[0];