Skip to content

Commit

Permalink
docs/library/utime.rst: Clarify behaviour and precision of sleep ms/us.
Browse files Browse the repository at this point in the history
This description is based on the existing bare-metal ports implementations.

Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Jul 21, 2021
1 parent db6d60b commit a5221c4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/library/utime.rst
Expand Up @@ -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
Expand Down

0 comments on commit a5221c4

Please sign in to comment.