Skip to content

Commit

Permalink
enable argumentless sleep(); closes RT #57294
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed May 31, 2010
1 parent 4f9ca44 commit cde6abe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/system.pm
Expand Up @@ -17,9 +17,13 @@ sub run($commandline) {
}
}

sub sleep($seconds) { # fractional seconds also allowed
sub sleep($seconds = Inf) { # fractional seconds also allowed
my $time1 = time;
pir::sleep__vN($seconds);
if $seconds ~~ Inf {
pir::sleep__vN(1e16) while True;
} else {
pir::sleep__vN($seconds);
}
my $time2 = time;
return $time2 - $time1;
}
Expand Down

0 comments on commit cde6abe

Please sign in to comment.