RosettaCodeData/Task/Sleep/Jq/sleep.jq

8 lines
221 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
# Pseudosleep for at least the given number of $seconds (a number)
# and emit the actual number of seconds that have elapsed.
def sleep($seconds):
now
| . as $now
| until( . - $now >= $seconds; now)
| . - $now ;