Timer module

How to require timer module

// require("globals");
//// OR
// var timer = require("timer");

Evaluates an expression after 0 milliseconds.

const id = timer.setTimeout(() => {
});

Evaluates an expression after 0 milliseconds.

const id = timer.setTimeout((arg) => {
}, 0, rnd);

Evaluates an expression after a specified number of milliseconds.

const id = timer.setTimeout(() => {
}, 10);

Cancels the evaluation with the clearTimeout method.

const id = timer.setTimeout(() => {
}, 50);

//// Clear timeout with specified id.
timer.clearTimeout(id);

Evaluates an expression each time a specified number of milliseconds has elapsed.

const id = timer.setInterval(() => {
}, 50);

Cancel the interval previously started using the setInterval method.

const id = timer.setInterval(() => {
    timer.clearInterval(id);
}, 50);

Stay connected with NativeScript

(expect a newsletter every 4-8 weeks)

NativeScript
NativeScript is licensed under the Apache 2.0 license .
© Progress Software Corporation. All Rights Reserved.