in reply to More Detailed Timing than Time::HiRes' clock method
#!/usr/bin/perl -w use strict; use warnings; use Time::HiRes qw( gettimeofday tv_interval ); my $start = [gettimeofday]; my $line; $line++ while (<>); # Count number of lines in the file(s) my $end = [gettimeofday]; my $difference = tv_interval($start, $end); print "It took ", $difference, " second\n";
which gives something like:
It took 0.000103 second
|
|---|