aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-12-21 14:33:01 +0000
committerYang Tse <yangsita@gmail.com>2009-12-21 14:33:01 +0000
commit1cfa52b67d649fd58de803290c6ba04d6615b891 (patch)
tree5600c145b1461e7833d69dc1cc640c3fcf5ba99e
parent57d3488a0d373151879ca622a4a90e2bbb72de14 (diff)
Reinstate hi resolution time logging since this is not what is
now adding 90 extra seconds to the total time some autobuilds need to make a full test-run.
-rw-r--r--tests/ftpserver.pl27
1 files changed, 14 insertions, 13 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index aff415f77..a73db0fac 100644
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -43,11 +43,12 @@ use IPC::Open2;
require "getpart.pm";
require "ftp.pm";
-#BEGIN {
-# if($] > 5.006) {
-# use Time::HiRes qw( gettimeofday );
-# }
-#}
+BEGIN {
+ if($] >= 5.007003) {
+ require Time::HiRes;
+ import Time::HiRes qw( gettimeofday );
+ }
+}
#**********************************************************************
# global vars...
@@ -127,18 +128,18 @@ sub getlogfilename {
#
sub logmsg {
my $now;
-# if($] > 5.006) {
-# my ($seconds, $usec) = gettimeofday();
-# my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
-# localtime($seconds);
-# $now = sprintf("%02d:%02d:%02d.%06d ", $hour, $min, $sec, $usec);
-# }
-# else {
+ if($] >= 5.007003) {
+ my ($seconds, $usec) = gettimeofday();
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ localtime($seconds);
+ $now = sprintf("%02d:%02d:%02d.%06d ", $hour, $min, $sec, $usec);
+ }
+ else {
my $seconds = time();
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($seconds);
$now = sprintf("%02d:%02d:%02d ", $hour, $min, $sec);
-# }
+ }
if(open(LOGFILEFH, ">>$logfilename")) {
print LOGFILEFH $now;
print LOGFILEFH @_;