-
• #2
Reference say: "Get the number of milliseconds" So the difference should be micro seconds.
why milli-milli=micro?
Not shure because a output of Date.now() looks like this 41866529.26635742187.
Still it can be milli but with fraction
BTW there is also
getTime()
- similar but in seconds with fractionEDIT: what is a bit strange is that in Bangle 2 emulator
Date.now()
has no fraction -
• #3
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. -
• #4
Ok, so it's 0.885 ms - Thanks
If you like to check the runtime of you code you can use something like this:
Are this 0.885 mili seconds or 0.885 micro second
Reference say:
Get the number of milliseconds elapsed since 1970 (or on embedded platforms, since startu)
So the difference should be micro seconds. Not shure because a output of Date.now() looks like this
41866529.26635742187
.