Run a function 5 times with intervals of 20 seconds

var count = 0; function myFunction() { count++; if(count > 5) clearInterval(timeout); //do something } var timeout = setInterval(myFunction, 20000);

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.