From d9a229ff0f6b77171fbf61cefc851c4d7498b200 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Fri, 30 Dec 2022 09:54:32 +0000 Subject: [PATCH] typos --- docs/blog/posts/better-sleep-on-windows.md | 4 ++-- src/textual/_time.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/blog/posts/better-sleep-on-windows.md b/docs/blog/posts/better-sleep-on-windows.md index 95ca507e4..d1c1842ad 100644 --- a/docs/blog/posts/better-sleep-on-windows.md +++ b/docs/blog/posts/better-sleep-on-windows.md @@ -28,7 +28,7 @@ On macOS and Linux, calling `asynco.sleep` is fairly accurate. If you call `slee This limit appears holds true for all async primitives on Windows. If you wait for something with a timeout, it will return on a multiple of 15 milliseconds. Fortunately there is work in the CPython pipeline to make this more accurate. Thanks to [Steve Dower](https://twitter.com/zooba) for pointing this out. -This lack of accuracy in the timer meant that timer events were created at a far slower rate that intended. Animation was slower because Textual was waiting too long between updates. +This lack of accuracy in the timer meant that timer events were created at a far slower rate than intended. Animation was slower because Textual was waiting too long between updates. Once I had figured that out, I needed an alternative to `asyncio.sleep` for Textual's Timer class. And I found one. The following version of `sleep` is accurate to well within 1%: @@ -39,7 +39,7 @@ from asyncio import get_running_loop async def sleep(sleep_for: float) -> None: """An asyncio sleep. - On Windows this achieves a better granularity that asyncio.sleep + On Windows this achieves a better granularity than asyncio.sleep Args: sleep_for (float): Seconds to sleep for. diff --git a/src/textual/_time.py b/src/textual/_time.py index f33246946..3343697a0 100644 --- a/src/textual/_time.py +++ b/src/textual/_time.py @@ -19,7 +19,7 @@ if WINDOWS: async def sleep(sleep_for: float) -> None: """An asyncio sleep. - On Windows this achieves a better granularity that asyncio.sleep + On Windows this achieves a better granularity than asyncio.sleep Args: sleep_for (float): Seconds to sleep for.