If you like to check the runtime of you code you can use something like this:
var t1, t2; t1 = Date.now() //begin code to messure a = analogRead(D28); // end code to messuere t2 = Date.now() print("runtime:", t2-t1); /* output runtime: 0.88500976562 */
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.
41866529.26635742187
@MaBe started
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.
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
.