From a5221c47eb60500506abf2c9967429879277714b Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 22 Jul 2021 00:04:01 +1000 Subject: [PATCH] docs/library/utime.rst: Clarify behaviour and precision of sleep ms/us. This description is based on the existing bare-metal ports implementations. Signed-off-by: Damien George --- docs/library/utime.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/library/utime.rst b/docs/library/utime.rst index b7c604dc7b..ef2a572aa4 100644 --- a/docs/library/utime.rst +++ b/docs/library/utime.rst @@ -74,10 +74,19 @@ Functions Delay for given number of milliseconds, should be positive or 0. + This function will delay for at least the given number of milliseconds, but + may take longer than that if other processing must take place, for example + interrupt handlers or other threads. Passing in 0 for *ms* will still allow + this other processing to occur. Use `sleep_us()` for more precise delays. + .. function:: sleep_us(us) Delay for given number of microseconds, should be positive or 0. + This function attempts to provide an accurate delay of at least *us* + microseconds, but it may take longer if the system has other higher priority + processing to perform. + .. function:: ticks_ms() Returns an increasing millisecond counter with an arbitrary reference point, that