summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>2010-04-22 12:36:31 -0700
committerRicardo Signes <rjbs@cpan.org>2010-05-05 07:51:46 -0400
commit31ea7660ba00d94d6877478fcb22b2f081c30027 (patch)
treed9045c8b14a1e3017042e94f950781d062c6efab
parent9fb79a0acb6cdf639531e2b243726c594d37c323 (diff)
downloadperl-31ea7660ba00d94d6877478fcb22b2f081c30027.tar.gz
time() resolution is full seconds
So any fudging in the timing needs to be at least 1 second to have any effect. Upped the total $sleep value to 4 (on Windows) to make sure at least 3 seconds have passed. Amends commit 0ebb4f0.
-rw-r--r--t/op/sselect.t6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/op/sselect.t b/t/op/sselect.t
index f4c95d4578..ffb4aadcf1 100644
--- a/t/op/sselect.t
+++ b/t/op/sselect.t
@@ -31,11 +31,13 @@ like ($@, qr/^Modification of a read-only value attempted/);
eval {select $blank, $blank, "a", 0};
like ($@, qr/^Modification of a read-only value attempted/);
-my $sleep = 3;
+my($sleep,$fudge) = (3,0);
# Actual sleep time on Windows may be rounded down to an integral
# multiple of the system clock tick interval. Clock tick interval
# is configurable, but usually about 15.625 milliseconds.
-my $fudge = $^O eq "MSWin32" ? 0.1 : 0;
+# time() however doesn't return fractional values, so the observed
+# delay may be 1 second short.
+($sleep,$fudge) = (4,1) if $^O eq "MSWin32";
my $t = time;
select(undef, undef, undef, $sleep);