Comment Comment by eloff You can also do this with a wrapper around setTimeout, if you're in an older environment: /\* \* A sleep function that returns a promise. \* \* @example \* Sleep for 100ms \* ``` \* await wait(100); \* ``` \*/ export async function wait(ms: number) { return new Promise(resolve => { setTimeout(resolve, ms); }); } parent eloff 5 years ago