--- IO-AIO/bin/treescan 2011/10/04 18:22:43 1.11 +++ IO-AIO/bin/treescan 2011/10/04 18:33:26 1.14 @@ -30,8 +30,7 @@ $opt_grep &&= qr{$opt_grep}s; my ($n_dirs, $n_files, $n_stats) = (0, 0, 0); -my $n_last; -my $n_start = Time::HiRes::time; +my ($n_last, $n_start) = (Time::HiRes::time) x 2; sub printfn { my ($prefix, $files, $suffix) = @_; @@ -56,7 +55,11 @@ if ($opt_progress and $n_last + 1 < Time::HiRes::time) { $n_last = Time::HiRes::time; - printf STDERR "%d dirs %d files %d stats %g stats/s \r", $n_dirs, $n_files, $n_stats, $n_stats / ($n_last - $n_start) + my $d = $n_last - $n_start; + printf STDERR "\r%d dirs (%g/s) %d files (%g/s) %d stats (%g/s) ", + $n_dirs, $n_dirs / $d, + $n_files, $n_files / $d, + $n_stats, $n_stats / $d if $opt_progress; } @@ -89,7 +92,6 @@ for my $seed (@ARGV) { $seed =~ s/\/+$//; - ++$n_stats; aio_lstat "$seed/.", sub { if ($_[0]) { print STDERR "$seed: $!\n";