Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js wait command

function wait(milliseconds) {
  const date = Date.now();
  let currentDate = null;
  do {
    currentDate = Date.now();
  } while (currentDate - date < milliseconds);
}

function your_code() {
  //code stuff
  wait(1000); //waits 1 second before continuing
  //other code stuff
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: for in object javascript 
Javascript :: difference between devDependency and dependency 
Javascript :: Convert a string to a number in jQuery 
Javascript :: jquery unbind event 
Javascript :: how to use more than one transform in javascript 
Javascript :: dayjs timezone 
Javascript :: set date input html using js 
Javascript :: reactjs get checkbox value 
Javascript :: jquery get text 
Javascript :: mongoose generate objectid 
Javascript :: useref not defined : error 
Javascript :: detect system dark mode javascrip 
Javascript :: $(getJson) returning error 
Javascript :: loop dictionary with key and value javascript 
Javascript :: async await catch error 
Javascript :: how to add checkbox in alert box in javascript 
Javascript :: spring rest api cors error in react app 
Javascript :: moment day in range 
Javascript :: how to change the tab text in React 
Javascript :: react hook toggle state 
Javascript :: mongoose find and update prop 
Javascript :: update nodejs ubuntu 
Javascript :: fatal error: ineffective mark-compacts near heap limit allocation failed – javascript heap out of memory 
Javascript :: js get current function name 
Javascript :: How to convert data to utf-8 in node.js 
Javascript :: immediate invoke function js 
Javascript :: javascript transition 
Javascript :: javascript get 24 hour time 
Javascript :: jquery change select option text 
Javascript :: react-native-reanimated npm 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =