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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
use Fcntl ':mode';
use File::Find qw();
use File::Basename qw(basename);
use Fcntl ':mode';
use File::Find qw();
use File::Basename qw(basename);
+use Time::HiRes qw(gettimeofday tv_interval);
-our $t0;
-if (eval { require Time::HiRes; 1; }) {
- $t0 = [Time::HiRes::gettimeofday()];
-}
+our $t0 = [ gettimeofday() ];
our $number_of_git_cmds = 0;
BEGIN {
our $number_of_git_cmds = 0;
BEGIN {
- our $t0 = [Time::HiRes::gettimeofday()]
+ our $t0 = [ gettimeofday() ]
if defined $t0;
our $number_of_git_cmds = 0;
}
if defined $t0;
our $number_of_git_cmds = 0;
}
print "<div id=\"generating_info\">\n";
print 'This page took '.
'<span id="generating_time" class="time_span">'.
print "<div id=\"generating_info\">\n";
print 'This page took '.
'<span id="generating_time" class="time_span">'.
- Time::HiRes::tv_interval($t0, [Time::HiRes::gettimeofday()]).
+ tv_interval($t0, [ gettimeofday() ]).
' seconds </span>'.
' and '.
'<span id="generating_cmd">'.
' seconds </span>'.
' and '.
'<span id="generating_cmd">'.
print 'END';
if (defined $t0 && gitweb_check_feature('timed')) {
print ' '.
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";
' '.$number_of_git_cmds;
}
print "\n";