• Generally manipulating large arrays of values directly in Espruino isn't going to be very quick, although the notes in http://www.espruino.com/Performance might help you out a bit.

    Since Espruino is single-threaded, it doesn't really matter what you do to use up the time if you want a function that takes a while. Simply doing:

    function wait1sec() {
      var  t = getTime()+1;
      while (getTime()<t);
    }
    

    Would work fine to give you a known delay - however while it's fine for debugging, doing it in any real code is not recommended (See FAQ: Is there a delay function)

About

Avatar for Gordon @Gordon started