Wednesday, July 17, 2013

JavaScript - setTimeOut vs setInterval

With JavaScript, it is possible to execute some code at specified time-intervals. This is called timing events.
It's very easy to time events in JavaScript. The two key methods that are used are:

  • setInterval() - executes a function, over and over again, at specified time intervals
  • setTimeout() - executes a function, once, after waiting a specified number of milliseconds

Reference:

http://www.w3schools.com/js/js_timing.asp

0 comments:

Post a Comment