setTimeoutLoop: JavaScript code on Bitbucket

setTimeoutLoop is a JavaScript function to allow dynamic calling of a specific function a designated number of times, with a designated delay.  For example, to run thisFunction() three times with a one-second delay each time, you could just type:

setTimeoutLoop(3, thisFunction);

Or, to run this code in a half-second-delayed loop, four times:

myFunct(var1, "Hi");

you could use:

setTimeoutLoop(4, myFunct, 500, var1, "Hi");

setTimeoutLoop can be downloaded from Bitbucket.  The readme file on the BitBucket page provides more information about usage and syntax.

No comments:

Post a Comment