【发布时间】:2013-12-04 18:01:50
【问题描述】:
我有这个 Perl 脚本,我需要在其中监控 DBI 调用的执行时间。
在欧洲(法国),我没问题:2秒执行时间报2秒。
在新加坡的一台计算机上运行的相同脚本报告 30 分 2 秒。
为什么?
use strict;
use Time::Format qw(%time);
use Time::HiRes qw(gettimeofday);
my $time_start = gettimeofday();
sleep 2; # some action goes here
my $stat_perf = gettimeofday() - $time_start;
print STDOUT $time{'mm:ss.mmm', $stat_perf} . " \n";
法国的产量是
00:02.000
在新加坡运行的相同脚本产生:
30:02.001
为什么?
【问题讨论】:
标签: perl timezone timezone-offset