export async function sleep ( timeoutInMs ) { return new Promise < void > ( ( res ) => { setTimeout ( ( ) => res ( ) , timeoutInMs ) ; } ) ; } export function immediatePromise ( ) { return new Promise < void > ( ( resolve ) => { setImmediate ( resolve ) ; } ) ; }