Possible Duplicate:
Sleep in Javascript
What do I do if I want a JavaScript version of sleep()?
Is it possible to implement a sleep function in Javascript?
I have this code:
var state = true;
$('#changeState').click(function(){
if (state == true)
state = false
else
state = true
})
while() {
//do something
if (state == false){
sleep();
}
}
Is it feasable?
Thanks for your help.