mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
bpo-42783: Documentation for asyncio.sleep(0) (#24002)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
This commit is contained in:
parent
deab1e54ff
commit
5c30145afb
1 changed files with 4 additions and 0 deletions
|
|
@ -293,6 +293,10 @@ Sleeping
|
|||
``sleep()`` always suspends the current task, allowing other tasks
|
||||
to run.
|
||||
|
||||
Setting the delay to 0 provides an optimized path to allow other
|
||||
tasks to run. This can be used by long-running functions to avoid
|
||||
blocking the event loop for the full duration of the function call.
|
||||
|
||||
.. _asyncio_example_sleep:
|
||||
|
||||
Example of coroutine displaying the current date every second
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue