--- lib/PXElator/httpd.pm 2009/07/31 20:45:09 96 +++ lib/PXElator/httpd.pm 2009/07/31 22:52:22 104 @@ -39,6 +39,8 @@ use html; our $static_pids; +use Time::HiRes qw/time/; + sub static { my ($client,$path) = @_; @@ -46,6 +48,8 @@ return if ! -f $full; + my $start_t = time(); + if ( my $pid = fork ) { # parent close($client); @@ -76,7 +80,11 @@ while( my $len = read $fh, $buff, $block ) { print $client $buff; $pos += $len; - printf "%s %d/%d %.2f%%\r", $path, $pos, $size, $pos * 100 / $size; + printf "%s %d/%d %.2f%% %.2f K/s\r" + , $path, $pos + , $size, $pos * 100 / $size + , ( $pos / 1024 ) / ( time() - $start_t ) + ; } close($fh); close($client);