An open API service indexing awesome lists of open source software.

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

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
}

```