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

Find how many days, hours, minutes, and seconds the micro:bit has been running.

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