How to start Timer in Javascript?

 Posted by vishalneeraj-24503 on 12/20/2013 | Category: JavaScript Interview questions | Views: 2564 | Points: 40

With the help of setInterval static method of window object.
We can invoke or start timer.


window.setInterval("javascript function",milliseconds);

For Example:-

var str = setInterval(function(){start_timer()},3000);

function start_timer()

Then it will shown Hello message in 3 seconds.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response