Skip to content
Delay with async/await
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
index.js
package.json
readme.MD

readme.MD

await-sleep

Simple sleep with async/await

Installation

npm install --save await-sleep

Usage

import * as sleep from 'await-sleep';

async function myAsyncFunction() {
  console.time('Sleeping');

  await sleep(1500);

  console.timeEnd('Sleeping'); // Sleeping: 1507.180ms
}
You can’t perform that action at this time.