Timer functions

Timer functions


  let i=setInterval(function(){
  	$("div").html("1000");};,3000)
  });
    let j=setTimeout(function(){
  	$("div").html("1000");};,3000)
  });
  		//To stop the timers , we use
  clearTimeout(j);
  clearInterval(i);

The timer functions are useful if we want to execute a function at different intervals of time, like every 10 seconds or every 1 hour.
The most basic use of a timer function is to set a time limit for answwering a question in an online examination,.
Another example of a time function is to implement a countdown timer.

Comments

Popular posts from this blog

Parallel Database design, query processing

Laravel | PHP | Basics | Part 2

Apache Hadoop | Running MapReduce Jobs