The best is an example. In some situations programist, want that function was invoked one after the other with some delay.
document.getElementById('TEMP').innerHTML += "fun01(); ";
document.getElementById('TEMP').innerHTML += "fun02(); ";
document.getElementById('TEMP').innerHTML += "fun03(); ";
This requires a lot of extra code that does not become clear, is not always possible to modify other functions.To facilitate the launch function at certain intervals, it is a good idea to create a class that implements the sleep().
“Class” jsSleep() runs function at certain intervals in easy way.You must first create object class jsSleep(), next use method setFunction([nameFunction], timeToWaitInMs), and add function name whose you want run in at certain intervals times. After that you can run method sleep([objectJsSleep]). Below is “class”: