Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node js async delay

const { promisify } = require('util');

const delay = promisify(setTimeout);

// Usage:
(async () => {
  console.log('1');
  await delay(1000);
  console.log('2');
})();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #node #js #async #delay
ADD COMMENT
Topic
Name
8+8 =