Difference between revisions of "Bot Playground/Built-in Functions/Timer control"

From SmartBots Developers Docs
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
 
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
<onlyinclude>Standard timer control routines of javascript: setTimeout, setInterval etc.</onlyinclude>
+
<onlyinclude>Standard timer control routines of JavaScript: setTimeout, setInterval etc.</onlyinclude>
  
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
// Call samples required
+
setTimeout(function() { console.log("This is a timer event!"); }, 5000);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
You can use standard javascript timer routines: setTimeout/clearTimeout and setInterval/clearInterval. For reference on these functions see official JavaScript reference.
+
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()]
  
== Examples ==
 
  
  
 
{{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: