(delay, result=None)
Coroutine that completes after a given time (in seconds).
Coroutine that completes after a given time (in seconds).
Coroutine that completes after a given time ( in seconds ) .
async def sleep(delay, result=None):
    """Coroutine that completes after a given time (in seconds)."""
    if delay <= 0:
        await __sleep0()
        return result

    loop = events.get_running_loop()
    future = loop.create_future()
    h = loop.call_later(delay,
                        futures._set_result_unless_cancelled,
                        future, result)
    try:
        return await future
    finally:
        h.cancel()
async def sleep ( delay , result = None ) : if delay <= 0 : await __sleep0 ( ) return result loop = events . get_running_loop ( ) future = loop . create_future ( ) h = loop . call_later ( delay , futures . _set_result_unless_cancelled , future , result ) try : return await future finally : h . cancel ( )