Created
September 19, 2016 01:20
-
-
Save you21979/79aa809fc5dc4b3614826a91c9a0f523 to your computer and use it in GitHub Desktop.
trycatch
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
var x = function(){ | |
try{ | |
for(var i=0;i<100;++i){} | |
}catch(e){ | |
} | |
} | |
var x2 = function(){ | |
for(var i=0;i<100;++i){} | |
} | |
var MAX = 100000; | |
console.time("a") | |
for(var i=0;i<MAX;++i)x() | |
console.timeEnd("a") | |
console.time("b") | |
for(var i=0;i<MAX;++i)x2() | |
console.timeEnd("b") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment