Delay a promise a specified amount of time. Always fast as possible.
MIT License
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
import wait from 'fast-wait';
async function test() {
await wait(); // it will use Promise#then
await wait(200); // it will use setTimeout
}
test();
fast-wait x 10000 = 52ms
setTimeout x 10000 = 12957ms
Star this project on GitHub.