in reply to Clocking Portion of Your Perl Code
Usage/Output:#!/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");
[sk]% bench *.csv Counted 900285 lines It took 2 wallclock secs ( 1.88 usr + 0.27 sys = 2.15 CPU)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Clocking Portion of Your Perl Code
by Anonymous Monk on Jun 12, 2005 at 09:57 UTC | |
by kaif (Friar) on Jun 13, 2005 at 01:16 UTC |