-
there are promises, setTimeout (just google 'javascript sleep')
promises are too cumbersome (for me :)). setTimeout is not blocking current "thread". Though it is possible to issue multiple growing timeouts for each message.
or in this case you can send next message in ack/nack handler of previous message?
That is exactly what I've done. And this is the best way. Better than a "pause".
To make fastest sleep ever? You can shoot yourself in the foot much easier in javascript via for or while loop, or even digitalPulse, no need for inline C to block everything.
while loop will eat energy. Sleep supposed to halt CPU. Yes in case of single threaded it will stop everything. Question - will it stop UARTs?
this needs to run gcc behind scenes, you are probably copy pasting directly to console
yes :(. Understood.
there are promises, setTimeout (just google 'javascript sleep') or in this case you can send next message in ack/nack handler of previous message?
To make fastest sleep ever? You can shoot yourself in the foot much easier in javascript via
for
orwhile
loop, or evendigitalPulse
, no need for inline C to block everything.this needs to run gcc behind scenes, you are probably copy pasting directly to console or directly upload file or compiler in WebIDE does not work for some reason.