File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -271,11 +271,16 @@ say sleep-timer 0; # OUTPUT: 0
271
271
272
272
sub sleep-until(Instant $until --> Bool)
273
273
274
- Works just like C < sleep > but checks the current time and goes back to sleep
275
- if accidentally woken up early, to guarantee waiting until the specified
276
- time. Returns C < True > if the function actually waited, or if the specified
277
- time happens to be the present moment. Returns C < False > if you asked to
278
- sleep until a time in the past.
274
+ Works similar to C < sleep > but checks the current time and keeps sleeping
275
+ until the required instant in the future has been reached.
276
+ It uses internally the C < sleep-timer > method in a loop to ensure that,
277
+ if accidentaly woken up early, it will wait again for the specified
278
+ amount of time remaining to reach the specified instant.
279
+ goes back to sleep
280
+
281
+ Returns C < True > if the C < Instant > in the future has been achieved (either
282
+ by mean of sleeping or because it is right now), C < False > in the case
283
+ an C < Instant > in the past has been specified.
279
284
280
285
To sleep until 10 seconds into the future, one could write something like this:
281
286
You can’t perform that action at this time.
0 commit comments