Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

fast-wait

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-wait

Delay a promise a specified amount of time. Always fast as possible.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

fast-wait

Delay a promise a specified amount of time. Always fast as possible. For empty delay it will try to resolve fast as possible. For delay > 0 it will use standard setTimeout

NPM version

Usage

import wait from 'fast-wait';

async function test() {
  await wait(); // it will use Promise#then

  await wait(200); // it will use setTimeout
}

test();

Performance

fast-wait x 10000 = 52ms
setTimeout x 10000 = 12957ms

Support us

Star this project on GitHub.

Credits

Zlatko Fedor

Keywords

wait

FAQs

Package last updated on 27 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts