Skip to content

Commit dc38e4d

Browse files
authored
Merge pull request micropython#8685 from jepler/document-monotonic-better
Document that the "monotonic" values are only monotonic in one code run
2 parents d7014d9 + b5a946e commit dc38e4d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

shared-bindings/time/__init__.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
//|
4343
//| def monotonic() -> float:
4444
//| """Returns an always increasing value of time with an unknown reference
45-
//| point. Only use it to compare against other values from `time.monotonic()`.
45+
//| point. Only use it to compare against other values from `time.monotonic()`
46+
//| during the same code run.
4647
//|
4748
//| On most boards, `time.monotonic()` converts a 64-bit millisecond tick counter
4849
//| to a float. Floats on most boards are encoded in 30 bits internally, with
@@ -212,6 +213,8 @@ MP_DEFINE_CONST_FUN_OBJ_0(time_time_obj, time_time);
212213
//| def monotonic_ns() -> int:
213214
//| """Return the time of the monotonic clock, which cannot go backward, in nanoseconds.
214215
//| Not available on boards without long integer support.
216+
//| Only use it to compare against other values from `time.monotonic()`
217+
//| during a single code run.
215218
//|
216219
//| :return: the current time
217220
//| :rtype: int"""

0 commit comments

Comments
 (0)