Skip to content

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

License

Notifications You must be signed in to change notification settings

seeden/fast-wait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published