pxt-calliope/docs/reference/control/millis.md
2020-08-19 22:03:58 +02:00

469 B

millis

Get the number of milliseconds of time passed since the board was turned on.

control.millis()

Returns

  • the number of milliseconds of time since the board was turned on.

Example #example

Find how many days, hours, minutes, and seconds the @boardname@ has been running.

let msecs = control.millis()
let seconds = msecs / 1000
let mins = seconds / 60
let hours = mins / 60
let days = hours / 24

#seealso