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

From SmartBots Developers Docs
Jump to: navigation, search
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 JavaScripttimer routines:  
 +
* [https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout setTimeout()]
 +
* clearTimeout()
 +
* setInterval()
 +
* clearInterval()
  
== Examples ==
 
  
  
 
{{NavMenu}}
 
{{NavMenu}}
 
__NOTOC__
 
__NOTOC__

Revision as of 15:00, 6 October 2016

Standard timer control routines of JavaScript: setTimeout, setInterval etc.

setTimeout(function() { console.log("This is a timer event!"); }, 5000);

You can use standard JavaScripttimer routines: