From: Jakub Narebski Date: Tue, 9 Nov 2010 18:27:54 +0000 (+0100) Subject: gitweb: Time::HiRes is in core for Perl 5.8 X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/9271fbd96d9654bffc913807f29f385c5d57b03b4b34e4528962ac1a0643ba28 gitweb: Time::HiRes is in core for Perl 5.8 We say 'use 5.008' at the beginning of the script, therefore there is no need to check if Time::HiRes module is available. We can also import gettimeofday and tv_interval. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index 2a73955..dd45026 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -17,12 +17,10 @@ use Encode; use Fcntl ':mode'; use File::Find qw(); use File::Basename qw(basename); +use Time::HiRes qw(gettimeofday tv_interval); binmode STDOUT, ':utf8'; -our $t0; -if (eval { require Time::HiRes; 1; }) { - $t0 = [Time::HiRes::gettimeofday()]; -} +our $t0 = [ gettimeofday() ]; our $number_of_git_cmds = 0; BEGIN { @@ -1066,7 +1064,7 @@ sub dispatch { } sub reset_timer { - our $t0 = [Time::HiRes::gettimeofday()] + our $t0 = [ gettimeofday() ] if defined $t0; our $number_of_git_cmds = 0; } @@ -3591,7 +3589,7 @@ sub git_footer_html { print "
\n"; print 'This page took '. ''. - Time::HiRes::tv_interval($t0, [Time::HiRes::gettimeofday()]). + tv_interval($t0, [ gettimeofday() ]). ' seconds '. ' and '. ''. @@ -5299,7 +5297,7 @@ sub git_blame_common { print 'END'; if (defined $t0 && gitweb_check_feature('timed')) { print ' '. - Time::HiRes::tv_interval($t0, [Time::HiRes::gettimeofday()]). + tv_interval($t0, [ gettimeofday() ]). ' '.$number_of_git_cmds; } print "\n";