Commit 9dea7444 authored by Mike Hibler's avatar Mike Hibler
Browse files

Do runtime loading of strftime function from POSIX module

parent bb4adae3
...@@ -38,9 +38,6 @@ use English; ...@@ -38,9 +38,6 @@ use English;
# The tmcc library. # The tmcc library.
use libtmcc; use libtmcc;
# For timestamps
use POSIX qw(strftime);
# #
# This is the VERSION. We send it through to tmcd so it knows what version # This is the VERSION. We send it through to tmcd so it knows what version
# responses this file is expecting. # responses this file is expecting.
...@@ -1316,6 +1313,7 @@ sub TBForkCmd($) { ...@@ -1316,6 +1313,7 @@ sub TBForkCmd($) {
# TBTimeStamp() # TBTimeStamp()
# #
my $imported_hires = 0; my $imported_hires = 0;
my $imported_POSIX = 0;
sub TBTimeStamp() sub TBTimeStamp()
{ {
...@@ -1327,6 +1325,11 @@ sub TBTimeStamp() ...@@ -1327,6 +1325,11 @@ sub TBTimeStamp()
} }
my ($seconds, $microseconds) = Time::HiRes::gettimeofday(); my ($seconds, $microseconds) = Time::HiRes::gettimeofday();
if (! $imported_POSIX) {
require POSIX;
import POSIX::strftime;
$imported_POSIX = 1;
}
return POSIX::strftime("%H:%M:%S", localtime($seconds)) . ":$microseconds"; return POSIX::strftime("%H:%M:%S", localtime($seconds)) . ":$microseconds";
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment