Skip to content
Advertisement

Tag: settimeout

how to stop other code from executing while set timeout is executing?

This question is duplicate of How to stop other code from running until setTimeout() finishes running? In the above question the person does not want any code to be executed until the setTimeout function has been executed. So that function never get executed. But here in my case I want the code after the setTimeout to execute.(after setTimeout has finished

setTimeout with ajax

I am stuck,I can’t use the setInterval function with ajax. this if a simplified version of what I want my code to do. As said in the code,I tried using setTimeout too but it didn’t work,javascript just ignores the funcion setInterval or setTimeout. Answer setInterval requires the first parameter to be a function.

Javascript – SetTimeOut not working as intended

I’ve been trying to make a game as an exercise for class and I wanted to add a “timer” on it using “SetTimeOut”. If the timer reaches 0 the game should end instantly, but apparently the time starts running when the game ends, and not when the game starts. In this example I’ve put 4000 milliseconds just for testing purposes.

set timeout to event listener function

I have an event listener I would like to have a timeout for this event listener. So let’s say that if it doesn’t receive any event called ‘evt’ in 3 seconds I would like to have a notification that it timed out. I tried with the setTimeout function but so far I don’t manage to pass an internal variable of

Advertisement