Difference between revisions of "Bot Playground/Built-in Functions/Timer control"
From SmartBots Developers Docs
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
− | <onlyinclude>Standard timer control routines of | + | <onlyinclude>Standard timer control routines of JavaScript: setTimeout, setInterval etc.</onlyinclude> |
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
− | + | setTimeout(function() { console.log("This is a timer event!"); }, 5000); | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | You can use standard | + | You can use standard JavaScript timer routines: |
+ | * [https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout setTimeout()] | ||
+ | * [https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout clearTimeout()] | ||
+ | * [https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval setInterval()] | ||
+ | * [https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval clearInterval()] | ||
− | |||
{{NavMenu}} | {{NavMenu}} | ||
__NOTOC__ | __NOTOC__ |
Latest revision as of 20:56, 6 October 2022
Standard timer control routines of JavaScript: setTimeout, setInterval etc.
setTimeout(function() { console.log("This is a timer event!"); }, 5000);
You can use standard JavaScript timer routines: