projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea71c68
)
fix occasional op/time.t failure
author
Dave Mitchell
<davem@fdisolutions.com>
Mon, 8 Jan 2007 00:14:22 +0000
(
00:14
+0000)
committer
Dave Mitchell
<davem@fdisolutions.com>
Mon, 8 Jan 2007 00:14:22 +0000
(
00:14
+0000)
test 2 uses far more sys than user time, so it's possible to burn
20 secs of wall time without an apparent increase in user time
p4raw-id: //depot/perl@29712
t/op/time.t
patch
|
blob
|
history
diff --git
a/t/op/time.t
b/t/op/time.t
index
330cc86
..
8b2f07d
100755
(executable)
--- a/
t/op/time.t
+++ b/
t/op/time.t
@@
-19,6
+19,7
@@
while (($now = time) == $beg) { sleep 1 }
ok($now > $beg && $now - $beg < 10, 'very basic time test');
for ($i = 0; $i < 1_000_000; $i++) {
+ for my $j (1..100) {}; # burn some user cycles
($nowuser, $nowsys) = times;
$i = 2_000_000 if $nowuser > $beguser && ( $nowsys >= $begsys ||
(!$nowsys && !$begsys));