-
-
Save AtsushiM/266d2902cba8be7a7c647d9267bd5c00 to your computer and use it in GitHub Desktop.
jsの実行速度さっくり図るjs
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
(function() { | |
var start, end, i; | |
start = (new Date()).getTime(); | |
for (i = 0; i < 10000000; i++ ) { | |
(function(){ | |
var hoge; | |
return; // これの有り無しとかで調査 | |
hoge = function () { | |
var a; | |
a = 10000; | |
function hogehoge () { | |
console.log('no action.'); | |
} | |
function fugafuga () { | |
console.log('no action.'); | |
} | |
}; | |
hoge(); | |
})(); | |
} | |
end = (new Date()).getTime(); | |
console.log('execute:' + (end - start)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment