settimeout vs single setinterval javascript code example
Example 1: difference between setTimeout() and setInterval()
.setTimeout() //executes the code after x seconds.
.setInterval() //executes the code **every** x seconds.
Example 2: setinterval vs settimeout in javascript\
var intervalID = scope.setInterval(func, [delay, arg1, arg2, ...]);
var intervalID = scope.setInterval(function[, delay]);
var intervalID = scope.setInterval(code, [delay]);