setTimeout
Start from API_LEVEL
2.0
. Please refer to API_LEVEL.
Set a timer and execute the registered callback function after the timer expires.
Type
function setTimeout(callback: Callback, delay?: Delay): TimeoutID
Parameters
Callback
Type | Description |
---|---|
() => unknown | Callback functions executed after the timer expires |
Delay
Type | Description |
---|---|
number | The number of milliseconds to delay the function, default 1ms |
TimeoutID
Type | Description |
---|---|
number | Timer number |
Example
setTimeout(() => {
console.log('Hello Zepp OS')
}, 1000)