Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js sleep

function sleep(milliseconds) {
  var start = new Date().getTime();
  for (var i = 0; i < 1e7; i++) {
    if ((new Date().getTime() - start) > milliseconds){
      break;
    }
  }
}
console.log('First');
sleep(1000);
console.log('Second');
Source by stickynotepickles.herokuapp.com #
 
PREVIOUS NEXT
Tagged: #js #sleep
ADD COMMENT
Topic
Name
6+3 =