From b2c8f4fed24533d6c3c5d2b6b9c71d29cf62b327 Mon Sep 17 00:00:00 2001 From: Buck McCready Date: Sat, 5 Feb 2022 10:45:36 -0800 Subject: [PATCH 1/2] Clarify platform specific resolution in sleep function docs --- tokio/src/time/driver/sleep.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tokio/src/time/driver/sleep.rs b/tokio/src/time/driver/sleep.rs index 7f27ef201f7..33e0fa81364 100644 --- a/tokio/src/time/driver/sleep.rs +++ b/tokio/src/time/driver/sleep.rs @@ -72,7 +72,9 @@ pub fn sleep_until(deadline: Instant) -> Sleep { /// /// No work is performed while awaiting on the sleep future to complete. `Sleep` /// operates at millisecond granularity and should not be used for tasks that -/// require high-resolution timers. +/// require high-resolution timers. The implementation is platform specific +/// such that the actual resolution may be greater than 1 millisecond and vary +/// between platforms. /// /// To run something regularly on a schedule, see [`interval`]. /// From 310af930750c77fc40268e32ae6e3d365ad94bf8 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Wed, 16 Mar 2022 15:14:05 +0100 Subject: [PATCH 2/2] Update tokio/src/time/driver/sleep.rs --- tokio/src/time/driver/sleep.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tokio/src/time/driver/sleep.rs b/tokio/src/time/driver/sleep.rs index 33e0fa81364..041e5c06c25 100644 --- a/tokio/src/time/driver/sleep.rs +++ b/tokio/src/time/driver/sleep.rs @@ -72,9 +72,9 @@ pub fn sleep_until(deadline: Instant) -> Sleep { /// /// No work is performed while awaiting on the sleep future to complete. `Sleep` /// operates at millisecond granularity and should not be used for tasks that -/// require high-resolution timers. The implementation is platform specific -/// such that the actual resolution may be greater than 1 millisecond and vary -/// between platforms. +/// require high-resolution timers. The implementation is platform specific, +/// and some platforms (specifically Windows) will provide timers with a +/// larger resolution than 1 ms. /// /// To run something regularly on a schedule, see [`interval`]. ///