/**
* Creates a Promise that resolves some number of milliseconds
* after creation. Useful for pausing in async functions.
* @param ms Milliseconds to sleep before resolving.
*/
export default function sleep(ms: number) {
return new Promise<void>(resolve => {
setTimeout(resolve, ms);
});
}