The only things that block when connecting are WIZnet and CC3000. The ESP8266 (via AT commands or when running on ESP8266 itself) doesn't. After that, nothing blocks at all.
But yes, if something blocks (let's just say a big FOR loop) then setInterval will try and catch up - but it will do so by calling the interval only once around each idle loop.
So if you have:
setInterval(a,20);
setIntervall(b,40);
You'd expect normally it'd do:
aabaabaabaabaabaabaabaab...
But when catching up it'd do:
abababababababab ... now caught up ... aabaabaabaab
And yes, to avoid it, just do a setTimeout when executing - but it won't be as accurate.
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.
The only things that block when connecting are WIZnet and CC3000. The ESP8266 (via AT commands or when running on ESP8266 itself) doesn't. After that, nothing blocks at all.
But yes, if something blocks (let's just say a big FOR loop) then
setInterval
will try and catch up - but it will do so by calling the interval only once around each idle loop.So if you have:
You'd expect normally it'd do:
But when catching up it'd do:
And yes, to avoid it, just do a
setTimeout
when executing - but it won't be as accurate.