How to execute a function at regular intervals using Javascript

 

Use the code below to execute a function at regular intervals.

var timer = null;
var interval = 1000; // interval is defined in ms
var function_to_execute = 'function()';
timer = setInterval(function_to_execute, interval); 

Please feel free to use the comments form below if you have any questions or need more explanation on anything.

Tags

javascript,

Popular Searches

php, linux, mysql, ubuntu, mysql mysql, tools, install mysql, gearman, source code, java

more>>

Comments (write a comment):

0 comments so far. Be the first one to leave a comment on this article.

 

Comment