javascript question
•
28 Sep 2009, 14:36
•
Journals
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
(Sorry, I have no idea how you would really do it.)
from google
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.
or
function wait(millis){
var time=(new Date()).getTime();
while((new Date()).getTime()<time + millis){};
}
javascript has no build-in function for that