Skip to content

Commit

Permalink
sleep() for correct number of seconds for values above 1e16 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Nov 26, 2016
1 parent c797d3f commit 7c5ea31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/Date.pm
Expand Up @@ -199,7 +199,10 @@ sub sleep($seconds = Inf --> Nil) {
nqp::sleep(1e16) while True;
}
elsif $seconds > 1e16 {
nqp::sleep(1e16) for ^$seconds.Num.polymod: 1e16 xx *;
nqp::sleep($_) for gather {
1e16.take xx ($seconds / 1e16);
take $seconds - 1e16 * ($seconds / 1e16).Int;
}
}
elsif $seconds > 0 {
nqp::sleep($seconds.Num);
Expand Down

0 comments on commit 7c5ea31

Please sign in to comment.