• during some testing, I tried to compare speed of 2 solutions.
    It figured out, this is not possible. As you can see in listing below, even for simple loop result is not reliable.
    To avoid misunderstanding, I'm pretty sure reason is not Espruino or emulator.
    Would see reason being located in browser and/or OS

    var d = new Date(); for(var i = 0; i < 1000;i++){var b = 1 + 3;} console.log(new Date() - d);
    17
    =undefined
    >var d = new Date(); for(var i = 0; i < 1000;i++){var b = 1 + 3;} console.log(new Date() - d);
    15
    =undefined
    >var d = new Date(); for(var i = 0; i < 1000;i++){var b = 1 + 3;} console.log(new Date() - d);
    26
    
About

Avatar for JumJum @JumJum started