Basic logic of how this widget reaches under 10 ms accuracy with setTime (in version v0.00-beta-026):
Internal clock error counter is updated periodically according to given clock drift.
If clock error exceeds given threshold then clock update is attempted.
setTime can only set time to full seconds. To set time more accurately
a short delay is done until next full second, and then setTime is used.
Sometimes this delay can be longer than intented, e.g. if watch is
busy doing something else. In this case setTime after too long delay
would be inaccurate and so it is skipped and retried again later.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Basic logic of how this widget reaches under 10 ms accuracy with
setTime
(in versionv0.00-beta-026
):setTime
can only set time to full seconds. To set time more accuratelya short delay is done until next full second, and then
setTime
is used.busy doing something else. In this case
setTime
after too long delaywould be inaccurate and so it is skipped and retried again later.