Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js sync delay

function wait(ms) {
    const start = Date.now();
	let now = start;
    while ( (now - start) < ms ) { now = Date.now(); }
}

// Usage:
console.log("Before wait...");
wait(5000);
console.log("After 5 seconds...");
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript text to clipboard 
Javascript :: calling a java function onClick with ajax 
Javascript :: jquery each has class 
Javascript :: canvas font colour 
Javascript :: redirect javascript timer 
Javascript :: vanilla javascript axios 
Javascript :: parseint array javascript 
Javascript :: fetch await 
Javascript :: helmet graphql playground 
Javascript :: array contains case insensitive javascript 
Javascript :: using material ui icons in react 
Javascript :: jquery ajax 
Javascript :: change window location javascript 
Javascript :: open link in new window chrome mac shortcut 
Javascript :: javascript get text between two words 
Javascript :: js remove duplicates from array 
Javascript :: jquery get class name 
Javascript :: nodejs open default browser on specific web page 
Javascript :: create-react native app without expo 
Javascript :: how to do text to speech in javascript 
Javascript :: stop propagation event 
Javascript :: javascript replace multiple spaces with single space 
Javascript :: javascript print int with leading zeros 
Javascript :: javascript convert number to string 
Javascript :: Jquery SEND TO START OF ARRAY 
Javascript :: getting user input in node js 
Javascript :: javascript regex number only 
Javascript :: jquery cancel ajax request on click 
Javascript :: react link underline 
Javascript :: how to change input required message react 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =