what is a bit strange is that in Bangle 2 emulator Date.now() has no fraction
Yes... If I recall the JS spec says that Date.now() should be a whole number. But since we usually keep track of time to finer accuracy than that it felt like it would have been a mistake to deliberately throw away info just to make it look like desktop JS.
On the emulator Date.now() is only giving us time accurate to 1ms so that's all we give.
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.
Yes... If I recall the JS spec says that
Date.now()
should be a whole number. But since we usually keep track of time to finer accuracy than that it felt like it would have been a mistake to deliberately throw away info just to make it look like desktop JS.On the emulator
Date.now()
is only giving us time accurate to 1ms so that's all we give.