Skip to content

Instantly share code, notes, and snippets.

@graup
Created November 26, 2018 05:09
Show Gist options
  • Save graup/bfbc5c1036724300e7bd12ae7f77c371 to your computer and use it in GitHub Desktop.
Save graup/bfbc5c1036724300e7bd12ae7f77c371 to your computer and use it in GitHub Desktop.
try {
const result = await timedAsync(originalAsyncFunction, {
slow: () => {
console.log('operation is slow and still going on'):
},
fast: () => {
console.log('operation finished quickly'):
}
});
} catch (e) {
console.log('operation threw an exception');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment