mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
tweak sleep granularity
This commit is contained in:
@@ -2,15 +2,17 @@ from asyncio import sleep
|
||||
from time import process_time, time
|
||||
|
||||
|
||||
SLEEP_GRANULARITY: float = 1 / 100
|
||||
SLEEP_GRANULARITY: float = 1 / 50
|
||||
SLEEP_IDLE: float = SLEEP_GRANULARITY / 2.0
|
||||
|
||||
|
||||
async def wait_for_idle(min_sleep: float = 0.01, max_sleep: float = 1) -> None:
|
||||
async def wait_for_idle(
|
||||
min_sleep: float = SLEEP_GRANULARITY, max_sleep: float = 1
|
||||
) -> None:
|
||||
"""Wait until the cpu isn't working very hard.
|
||||
|
||||
Args:
|
||||
min_sleep: Minimum time to wait. Defaults to 0.01.
|
||||
min_sleep: Minimum time to wait. Defaults to 1/50.
|
||||
max_sleep: Maximum time to wait. Defaults to 1.
|
||||
"""
|
||||
start_time = time()
|
||||
|
||||
Reference in New Issue
Block a user