Created
November 26, 2018 05:09
-
-
Save graup/bfbc5c1036724300e7bd12ae7f77c371 to your computer and use it in GitHub Desktop.
This file contains 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
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