my $start_time = [Time::HiRes::gettimeofday()]; my $diff = Time::HiRes::tv_interval($start_time); print \"\\n\\n$diff\\n\";
That's pretty much it -- that will give you high resolution elapsed time. Unless, of course, someone messes with the system clock.