-
-
Save alersenkevich/c2d060e0b2e60de167030fc3f97975bd to your computer and use it in GitHub Desktop.
promise timing wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const timingWrapper = <T>(fn: Function, ms: number): Promise<T> => new Promise( | |
resolve => setTimeout( | |
async () => resolve(await fn()), | |
ms, | |
), | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment