Jump to content

Is it possible....?


Niccaman

Recommended Posts

I suppose you could do something like it... Instead of looping you could use setInterval( expression ,  timeout ) to call your function every timeout milliseconds. setInterval returns an ID of sorts that can be used to cancel it. Consider this:

 

function loop() {
     // code to repeat
}

var interval = setInterval("loop()", 1); // run loop() every millisecond
setTimeout("clearInterval(interval)", 5000); // cancel in 5 seconds

Link to comment
https://forums.phpfreaks.com/topic/154639-is-it-possible/#findComment-814018
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.