Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript wait 1 second

  setTimeout(function(){ 
    console.log("Ready")
}, 1000);
Comment

javascript wait 5 sec

function stateChange(newState) {
    setTimeout(function () {
        if (newState == -1) {
            alert('VIDEO HAS STOPPED');
        }
    }, 5000);
}
Comment

javascript wait 1 second

setTimeout(() => {console.log('1 second finished!')}, 1000);
Comment

js wait 5 second

function sleep(num) {
	let now = new Date();
	const stop = now.getTime() + num;
	while(true) {
		now = new Date();
		if(now.getTime() > stop) return;
	}
}

sleep(1000)
console.log('delay 1 second');
Comment

javascript wait 10 seconds

setTimeout(function () {
        // ...
    }, 10000);

// or

.then(() => {
  // ...
  ({ timeout: 10000 });
      });
Comment

javascript wait 10 seconds

setTimeout(function(){ 
2    console.log("Ready")
3}, 1000);
Comment

PREVIOUS NEXT
Code Example
Javascript :: c# write to file in json 
Javascript :: react-dom.development.js:86 Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. 
Javascript :: javascript get int val 
Javascript :: react-router-dom v6 redirect 
Javascript :: store array in local storage js 
Javascript :: handle esc press js 
Javascript :: js arrays check if there is intersection 
Javascript :: get the size of the screen javascript 
Javascript :: add download buttons in datatable 
Javascript :: jquery datetimepicker format 
Javascript :: mongoose pull each 
Javascript :: play store rejected app due non-certified ads SDK 
Javascript :: router link active in vue.js 
Javascript :: javascript number to number with commas 
Javascript :: array loop js 
Javascript :: if json valide js 
Javascript :: javascript change table row color based on value 
Javascript :: divide array of objects to 4 arrays js 
Javascript :: fs node delete folder 
Javascript :: redis json get multiple paths 
Javascript :: jquery clone 
Javascript :: string contains in react 
Javascript :: javascript date to utc format 
Javascript :: datatable row color 
Javascript :: get previous url javascript 
Javascript :: js speech synthesis 
Javascript :: performance javascript 
Javascript :: exit program js 
Javascript :: javascript play sound on click 
Javascript :: javascript oncontextmenu 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =