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 startFast; | |
var startSlow; | |
var size = 1000000; // million | |
var loopCount = 0; | |
var loopTest = function () { | |
loopCount++; | |
if ( loopCount == ( size - 1 ) ) | |
console.log( 'loop result: ' + ( new Date() - startFast ) + 'ms' ); |
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 startFast; | |
var startSlow; | |
var size = 1000000; // million | |
var fast = function () { | |
for ( var i = 0; i < size; i++ ) { | |
( function () { | |
var j = i; | |
return function () { |
NewerOlder