If you have come across the requirement of executing timer tasks within a Jaggery code, then you can use the following code to do that. These are the same set of functions that you have in the browser.
One time tasks
You can also use clearTimeout and clearInterval functions to stop the task execution.
One time tasks
setTimeout(function() { var log = new Log(); log.info('setTimeout() is executed after 2s'); }, 2000);Recurring tasks
setInterval(function() { var log = new Log(); log.info('setInterval() is being executed within 4s intervals'); }, 4000);
A very excellent blog post. I am thankful for your blog post.
ReplyDeleteiron plus