102
rated 0 times
[
106]
[
4]
/ answers: 1 / hits: 49377
/ 14 Years ago, tue, june 15, 2010, 12:00:00
is there a function that would add a time delay between 2 lines of code. Not the settimeout, because settimeout requires a function/object in its arguments.
I am looking for something like this pseudo code
write abc;
delay(500);
write xyz;
TIA
Edit:
jimr's solution in my other thread worked for my purpose, and so is Robusto's.
I am just wondering why the sleep methods given by Robusto and CMS's link are not preferred. How would that be different than the settimeout method since they both introduce a pause in the code? (settimeout pauses before the function is executed, the sleep method pauses before the next line is executed.)
More From » javascript