Causes strange problems.
I have sleep(0.05); in a quite complicated script. It's actually inside a loop in a timeout.
The problem is, not only does it seem to stop the timeout, it seems to also stop the loop.
heres what I have:
PHP Code:
function onTimeout() {
for(i=0;i<=20;i++) {
if (i == 20) this.extended = true;
if (!this.extended && (i % 3 == 0)) {
sleep(0.05);
setTimer(0.05);
}
//Code here never gets executed
}
...
I tried restarting the timer after calling sleep() but the rest of the stuff after sleep(); in the timeout never gets executed.
edit: actually, it is being executed, but for some reason it's not working as it does without the sleep()