Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The result above is generated with this code:Counted 900285 lines It took 6245 wallclock secs ( 6242.69 usr + 1.87 sys = 6244.56 CPU)
#!/usr/bin/perl -w use Benchmark; my $start_time = new Benchmark; $line++ while (<>); # Count number of lines in the file(s) my $end_time = new Benchmark; my $difference = timediff($end_time, $start_time); print ("Counted $line lines\n"); print ("It took ", timestr($difference), "\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simplifying Timediff Output from Seconds to Hours and Minute
by GrandFather (Saint) on Sep 25, 2006 at 03:52 UTC | |
|
Re: Simplifying Timediff Output from Seconds to Hours and Minute
by McDarren (Abbot) on Sep 25, 2006 at 04:24 UTC | |
|
Re: Simplifying Timediff Output from Seconds to Hours and Minute
by monkfan (Curate) on Sep 25, 2006 at 06:59 UTC | |
|
Re: Simplifying Timediff Output from Seconds to Hours and Minute
by Limbic~Region (Chancellor) on Sep 25, 2006 at 12:52 UTC |