Thursday, June 19, 2008

Javascript setInterval, and setTimeout

Here is how you can set a timer in javascript.

setInterval(expression,interval)

or

setTimeout(expression,interval)

expression is a function that you want to call where interval is the time in milleseconds.

setInterval will repeatedly call the expression on the interval whereas setTimeout will call it only once.

No comments: