You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtimetime.monotonic()
# in code and the command line, the fraction of seconds was always .0
Behavior
I did observe this behavior last night on a device that was running for many days.
Note: that also after breaking the code with ctrl-c and importing time
and entering time.monotonic() in the command line, the fraction of seconds was always .0
Only after microcontroller.reset() this behavior stopped.
I will try to reproduce this with other controllers and CP 7.0.
But it will take days until I have a result ....
Description
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
This is a known problem with time.monotonic(), because of the low precision of floats (5-6 digits). We recommend you use time.monotonic_ns(), if you board supports it (must have longints). Or, if it works for you, you can use supervisor.ticks_ms(), which wrap but keep their precision.
See #342 (comment) for some background on the precision issue.
Also a possibility to programmatically reset to time.monotonic "0" would be helpful, as this situation can be detected quite easily, now that I know how,
CircuitPython version
Code/REPL
Behavior
I did observe this behavior last night on a device that was running for many days.
Note: that also after breaking the code with ctrl-c and importing time
and entering time.monotonic() in the command line, the fraction of seconds was always .0
Only after microcontroller.reset() this behavior stopped.
I will try to reproduce this with other controllers and CP 7.0.
But it will take days until I have a result ....
Description
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: