Results of 1 - 10 of about 87 for sleep (0.005 sec.)
- A Conceptual Overview of asyncio — Python 3.14.8 ドキュメント 12069
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » A Conceptual Overview of asyncio テーマ 自動 ライト ダーク | A Conceptual Overview of asyncio ¶ This HOWTO article seeks to help you build a sturd
...o a task that does (such as computing n-factorial)? How to write an asynchronous variant of an operation, such as an async sleep or database request. 参考 The guide that inspired this HOWTO article, by Alexander Nordin. This in-depth YouTube tutorial...this way, they're the flexible interface for you to make your own conditions for waiting and resuming. A homemade asyncio.sleep ¶ We'll go through an example of how you could leverage a future to create your own variant of asynchronous sleep ( async_...sleep ) which mimics asyncio.sleep() . This snippet registers a few tasks with the event loop and then awaits the task created by asyncio.create_task , which... - https://man.mtool.work/python/3.14/howto/a-conceptual-overview-of-asyncio.html
- A Conceptual Overview of asyncio — Python 3.14.8 ドキュメント 12069
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » A Conceptual Overview of asyncio テーマ 自動 ライト ダーク | A Conceptual Overview of asyncio ¶ This HOWTO article seeks to help you build a sturd
...o a task that does (such as computing n-factorial)? How to write an asynchronous variant of an operation, such as an async sleep or database request. 参考 The guide that inspired this HOWTO article, by Alexander Nordin. This in-depth YouTube tutorial...this way, they're the flexible interface for you to make your own conditions for waiting and resuming. A homemade asyncio.sleep ¶ We'll go through an example of how you could leverage a future to create your own variant of asynchronous sleep ( async_...sleep ) which mimics asyncio.sleep() . This snippet registers a few tasks with the event loop and then awaits the task created by asyncio.create_task , which... - https://man.mtool.work/python/3.14/howto/a-conceptual-overview-of-asyncio.html
- キュー — Python 3.14.8 ドキュメント 10685
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » ネットワーク通信とプロセス間通信 » asyncio --- 非同期 I/O » キュー テーマ 自動 ライト ダーク | キュー ¶ ソースコード: Lib/asyncio/q
...rt asyncio import random import time async def worker ( name , queue ): while True : # Get a "work item" out of the queue. sleep_for = await queue . get () # Sleep for the "sleep_for" seconds. await asyncio . sleep ( sleep_for ) # Notify the queue tha...t the "work item" has been processed. queue . task_done () print ( f ' { name } has slept for { sleep_for : .2f } seconds' ) async def main (): # Create a queue that we will use to store our "workload". queue = asyncio . Que...ue () # Generate random timings and put them into the queue. total_sleep_time = 0 for _ in range ( 20 ): sleep_for = random . uniform ( 0.05 , 1.0 ) total_sleep_time += sleep_for queue . put_nowa... - https://man.mtool.work/python/3.14/library/asyncio-queue.html
- キュー — Python 3.14.8 ドキュメント 10685
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » ネットワーク通信とプロセス間通信 » asyncio --- 非同期 I/O » キュー テーマ 自動 ライト ダーク | キュー ¶ ソースコード: Lib/asyncio/q
...rt asyncio import random import time async def worker ( name , queue ): while True : # Get a "work item" out of the queue. sleep_for = await queue . get () # Sleep for the "sleep_for" seconds. await asyncio . sleep ( sleep_for ) # Notify the queue tha...t the "work item" has been processed. queue . task_done () print ( f ' { name } has slept for { sleep_for : .2f } seconds' ) async def main (): # Create a queue that we will use to store our "workload". queue = asyncio . Que...ue () # Generate random timings and put them into the queue. total_sleep_time = 0 for _ in range ( 20 ): sleep_for = random . uniform ( 0.05 , 1.0 ) total_sleep_time += sleep_for queue . put_nowa... - https://man.mtool.work/python/3.14/library/asyncio-queue.html
- Command-line introspection tools — Python 3.14.8 ドキュメント 9918
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » ネットワーク通信とプロセス間通信 » asyncio --- 非同期 I/O » Command-line introspection tools テーマ 自動 ライト ダーク | Command-li
...for inspection and prints its process ID: example.py ¶ import asyncio import os async def play ( track ): await asyncio . sleep ( 3600 ) print ( f "? Finished: { track } " ) async def album ( name , tracks ): async with asyncio . TaskGroup () as tg :.../taskgroups.py:75 │ └── TaskGroup._aexit Lib/asyncio/taskgroups.py:124 │ ├── (T) TNDNBTG │ │ └── play example.py:4 │ │ └── sleep Lib/asyncio/tasks.py:702 │ └── (T) Levitate │ └── play example.py:4 │ └── sleep Lib/asyncio/tasks.py:702 └── (T) TMBTE └──.../asyncio/taskgroups.py:75 └── TaskGroup._aexit Lib/asyncio/taskgroups.py:124 ├── (T) DYWTYLM │ └── play example.py:4 │ └── sleep Lib/asyncio/tasks.py:702 └── (T) Aqua Regia └── play example.py:4 └── sleep Lib/asyncio/tasks.py:702 If the await graph co... - https://man.mtool.work/python/3.14/library/asyncio-tools.html
- Command-line introspection tools — Python 3.14.8 ドキュメント 9918
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » ネットワーク通信とプロセス間通信 » asyncio --- 非同期 I/O » Command-line introspection tools テーマ 自動 ライト ダーク | Command-li
...for inspection and prints its process ID: example.py ¶ import asyncio import os async def play ( track ): await asyncio . sleep ( 3600 ) print ( f "? Finished: { track } " ) async def album ( name , tracks ): async with asyncio . TaskGroup () as tg :.../taskgroups.py:75 │ └── TaskGroup._aexit Lib/asyncio/taskgroups.py:124 │ ├── (T) TNDNBTG │ │ └── play example.py:4 │ │ └── sleep Lib/asyncio/tasks.py:702 │ └── (T) Levitate │ └── play example.py:4 │ └── sleep Lib/asyncio/tasks.py:702 └── (T) TMBTE └──.../asyncio/taskgroups.py:75 └── TaskGroup._aexit Lib/asyncio/taskgroups.py:124 ├── (T) DYWTYLM │ └── play example.py:4 │ └── sleep Lib/asyncio/tasks.py:702 └── (T) Aqua Regia └── play example.py:4 └── sleep Lib/asyncio/tasks.py:702 If the await graph co... - https://man.mtool.work/python/3.14/library/asyncio-tools.html
- Coroutines and tasks — Python 3.14.8 ドキュメント 9851
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » ネットワーク通信とプロセス間通信 » asyncio --- 非同期 I/O » Coroutines and tasks テーマ 自動 ライト ダーク | Coroutines and tasks ¶
...こから 1 秒待って "world" を出力します: >>> import asyncio >>> async def main (): ... print ( 'hello' ) ... await asyncio . sleep ( 1 ) ... print ( 'world' ) >>> asyncio . run ( main ()) hello world 単にコルーチンを呼び出しただけでは、コルーチンの実行ス...2 秒間待機してから "world" と出力します: import asyncio import time async def say_after ( delay , what ): await asyncio . sleep ( delay ) print ( what ) async def main (): print ( f "started at { time . strftime ( ' %X ' ) } " ) await say_after ( 1 ,...nate_task_group (): """Used to force termination of a task group.""" raise TerminateTaskGroup () async def job ( task_id , sleep_time ): print ( f 'Task { task_id } : start' ) await asyncio . sleep ( sleep_time ) print ( f 'Task { task_id } : done' )... - https://man.mtool.work/python/3.14/library/asyncio-task.html
- Coroutines and tasks — Python 3.14.8 ドキュメント 9851
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » ネットワーク通信とプロセス間通信 » asyncio --- 非同期 I/O » Coroutines and tasks テーマ 自動 ライト ダーク | Coroutines and tasks ¶
...こから 1 秒待って "world" を出力します: >>> import asyncio >>> async def main (): ... print ( 'hello' ) ... await asyncio . sleep ( 1 ) ... print ( 'world' ) >>> asyncio . run ( main ()) hello world 単にコルーチンを呼び出しただけでは、コルーチンの実行ス...2 秒間待機してから "world" と出力します: import asyncio import time async def say_after ( delay , what ): await asyncio . sleep ( delay ) print ( what ) async def main (): print ( f "started at { time . strftime ( ' %X ' ) } " ) await say_after ( 1 ,...nate_task_group (): """Used to force termination of a task group.""" raise TerminateTaskGroup () async def job ( task_id , sleep_time ): print ( f 'Task { task_id } : start' ) await asyncio . sleep ( sleep_time ) print ( f 'Task { task_id } : done' )... - https://man.mtool.work/python/3.14/library/asyncio-task.html
- time --- 時刻データへのアクセスと変換 — Python 3.14.8 ドキュメント 7701
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 汎用オペレーティングシステムサービス » time --- 時刻データへのアクセスと変換 テーマ 自動 ライト ダーク | time --- 時刻データへのアク
...ば、ほとんどの Unix システムにおいて、クロックの 1 ティックの精度は 50 から 100 分の 1 秒に過ぎません。 一方、 time() および sleep() は Unix の同等の関数よりましな精度を持っています。時刻は浮動小数点数で表され、 time() は可能なかぎり最も正確な時刻を (Un...ix の gettimeofday() があればそれを使って) 返します。また sleep() にはゼロでない端数を与えることができます (Unix の select() があれば、それを使って実装しています)。 gmtime() , localtime(...unter, i.e. a clock with the highest available resolution to measure a short duration. It does include time elapsed during sleep. The clock is the same for all processes. The reference point of the returned value is undefined, so that only the differe... - https://man.mtool.work/python/3.14/library/time.html
- time --- 時刻データへのアクセスと変換 — Python 3.14.8 ドキュメント 7701
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 汎用オペレーティングシステムサービス » time --- 時刻データへのアクセスと変換 テーマ 自動 ライト ダーク | time --- 時刻データへのアク
...ば、ほとんどの Unix システムにおいて、クロックの 1 ティックの精度は 50 から 100 分の 1 秒に過ぎません。 一方、 time() および sleep() は Unix の同等の関数よりましな精度を持っています。時刻は浮動小数点数で表され、 time() は可能なかぎり最も正確な時刻を (Un...ix の gettimeofday() があればそれを使って) 返します。また sleep() にはゼロでない端数を与えることができます (Unix の select() があれば、それを使って実装しています)。 gmtime() , localtime(...unter, i.e. a clock with the highest available resolution to measure a short duration. It does include time elapsed during sleep. The clock is the same for all processes. The reference point of the returned value is undefined, so that only the differe... - https://man.mtool.work/python/3.14/library/time.html