-
-
Save wreckah/e50d58d8c6e44966dbebee626138dc56 to your computer and use it in GitHub Desktop.
Node.js try-catch perf
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
> console.time(); for (let i=0, j; i<1000000; i++) j++; console.timeEnd(); | |
default: 10.310ms | |
> console.time(); for (let i=0, j; i<1000000; i++) try {j++} catch (e) {}; console.timeEnd(); | |
default: 10.577ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment