Skip to content

Instantly share code, notes, and snippets.

@AtsushiM
Last active August 5, 2016 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AtsushiM/266d2902cba8be7a7c647d9267bd5c00 to your computer and use it in GitHub Desktop.
Save AtsushiM/266d2902cba8be7a7c647d9267bd5c00 to your computer and use it in GitHub Desktop.
jsの実行速度さっくり図るjs
(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