javascript question

hai there ive some output from the browsergame i currently write, basicly i just want to delay every row for a sec or two, i know the php sleep function does not work that way so i need some javascript which delays it for me
Comments
7
Worst possible approach: let it calculate something horribly big (build in recursions as well) that takes about a second or two. :D

(Sorry, I have no idea how you would really do it.)
no since its currently running on my localhost :p
Parent
nichtdieiiky, wer dann?
setTimeout ( expression, timeout );


from google
nice nick
PHP sleep wouldnt work, thats server side.,...

do what crumbs said

best to put your drawing/writing in a function and pass it a y coordinate for the level, and you increase that y-coordinate on each iteration of your output loop

remember timeout is in milliseconds.
setTimeout(method,millis);

or

function wait(millis){
var time=(new Date()).getTime();

while((new Date()).getTime()<time + millis){};

}

javascript has no build-in function for that
Back to top