yoctodelay
Version:
Delay a promise a specified amount of time
19 lines (13 loc) • 289 B
TypeScript
/**
Delay the promise and then resolve.
@param milliseconds - The duration to delay the promise.
@example
```
import delay from 'yoctodelay';
foo();
await delay(100);
// Executed 100 milliseconds later
bar();
```
*/
export default function delay(milliseconds: number): Promise<void>;