Skip to content

Instantly share code, notes, and snippets.

@alersenkevich
Last active March 11, 2018 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alersenkevich/c2d060e0b2e60de167030fc3f97975bd to your computer and use it in GitHub Desktop.
Save alersenkevich/c2d060e0b2e60de167030fc3f97975bd to your computer and use it in GitHub Desktop.
promise timing wrapper
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