You may have some trouble using watches on the potentiometer - setWatch is generally only for digital inputs.
But generally:
setWatch queues an event basically immediately with a timestamp, which is very deterministic
Espruino executes that event the next time around the idle loop, which depends on what JS you're currently executing
So as long as you keep the tasks that you're running reasonably short then your code is going to be executed within just a few milliseconds.
The only gotcha is if for example you're blasting the UART with data faster than it can transmit then that could fill the output buffer and stop a function executing quickly, which could slow things down.
However if you're talking about buttons and user input, setWatch is basically immediate - pretty much whatever you do it'll be executing the JS before you know it :)
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.
You may have some trouble using watches on the potentiometer - setWatch is generally only for digital inputs.
But generally:
So as long as you keep the tasks that you're running reasonably short then your code is going to be executed within just a few milliseconds.
The only gotcha is if for example you're blasting the UART with data faster than it can transmit then that could fill the output buffer and stop a function executing quickly, which could slow things down.
However if you're talking about buttons and user input,
setWatch
is basically immediate - pretty much whatever you do it'll be executing the JS before you know it :)