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 <damien@micropython.org>
This commit is contained in:
Damien George 2021-07-22 00:04:01 +10:00
parent db6d60b079
commit a5221c47eb
1 changed files with 9 additions and 0 deletions

View File

@ -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