https://github.com/sorenlouv/await-sleep
Delay with async/await
https://github.com/sorenlouv/await-sleep
async await blocking delay es6 javascript promise sleep
Last synced: 2 months ago
JSON representation
Delay with async/await
- Host: GitHub
- URL: https://github.com/sorenlouv/await-sleep
- Owner: sorenlouv
- Created: 2017-08-17T08:34:36.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-13T00:20:56.000Z (over 3 years ago)
- Last Synced: 2025-04-05T08:51:12.006Z (3 months ago)
- Topics: async, await, blocking, delay, es6, javascript, promise, sleep
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 39
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: readme.MD
Awesome Lists containing this project
README
# await-sleep
Simple sleep with async/await
## Installation
```bash
npm install --save await-sleep
```## Usage
```js
import * as sleep from 'await-sleep';async function myAsyncFunction() {
console.time('Sleeping');await sleep(1500);
console.timeEnd('Sleeping'); // Sleeping: 1507.180ms
}```