don't measure speed with bangle emulator

Posted on
  • 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
    
  • Advice taken... both ways...

    One of the reasons you use an emulator / simulator is to get it faster... in an environment with way more luxury in the context. But when it comes to real timing, nothing beats the real device (for 'reality'). ;|>

  • Would see reason being located in browser and/or OS

    With that being said: would it still be possible to modify the emulator to run with the same speed as the actual watch? Maybe enabled by option?

    This could be helpful to see if the code written in emulator would be efficiently running on the watch as well.

  • That's much easier said than done! It's not emulating it at an instruction level so really there's no easy way to know how long something should take (even roughly!).

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

don't measure speed with bangle emulator

Posted by Avatar for JumJum @JumJum

Actions