3 use Test::More tests => 2;
4 BEGIN { push @INC, '.' }
7 BEGIN { require_ok "Time::HiRes"; }
10 skip "no gettimeofday", 1 unless &Time::HiRes::d_gettimeofday;
11 my ($s, $n, $i) = (0);
13 $s += Time::HiRes::time() - CORE::time();
16 # $s should be, at worst, equal to $n
17 # (CORE::time() may be rounding down, up, or closest),
18 # but allow 10% of slop.
19 ok abs($s) / $n <= 1.10
20 or print("# Time::HiRes::time() not close to CORE::time()\n");
21 printf("# s = $s, n = $n, s/n = %s\n", abs($s)/$n);