clearTimeout()
Overview
Clears a timer started with setTimeout().
Added in version 2.1.5
Format
clearTimeout(timerId);
Value | Description | Type | Required |
---|---|---|---|
timerId | The timer number to be cleared. The same number returned by setTimeout(). | Integer | Required |
Example
Copy
/* Press the letter 'z' if no keys are pressed in the next 20 seconds.
*/
var id = setTimeout(function() {
Device.sendKeys("z");
}, 20000);
function waitForKey(event) {
clearTimeout(id);
WLEvent.off("Key", waitForKey, "session");
}
WLEvent.on("Key", waitForKey, "session");