lev.sleep

lev

sleep(seconds, cancel) -> true, err

Suspend the current coroutine for a duration

Yields the current coroutine and resumes it after the given number of seconds (fractional seconds supported). Returns true on normal completion, or nil, "cancelled" if the cancel token has fired by the time the coroutine wakes up.