Created
June 30, 2010 03:41
-
-
Save neonstalwart/458214 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 start = Date.now(), | |
i = 1e5, | |
a = [0,1,2,3,4,5,6,7,8,9], | |
total, l, j; | |
while(i--){ | |
total = 0; | |
// uncomment the line you want to test | |
l = a.length; while(l--){ total = total + a[l]; } | |
//for(j = 0, l=a.length; j < l; j++){ total = total + a[j]; } | |
//dojo.forEach(a, function(i){ total = total + i; }); | |
//a.forEach(function(i){total = total + i}); | |
} | |
console.log(Date.now() - start); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment