Created
January 27, 2010 00:31
-
-
Save bga/287413 to your computer and use it in GitHub Desktop.
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 i,n=300000; | |
var d0=new Date().getTime(); | |
for(i=0;i<n;++i) | |
"1.5"-0; | |
alert("-0: "+(new Date().getTime()-d0)+" ms"); | |
var d0=new Date().getTime(); | |
for(i=0;i<n;++i) | |
+"1.5"; | |
alert("+: "+(new Date().getTime()-d0)+" ms"); | |
/* | |
opera 10.10 | |
-0: 581 | |
+: 460 | |
webkit | |
-0: 1195 | |
+: 997 | |
ff3.6 | |
-0: 421 | |
+: 522 | |
ie7 | |
-0: 771 | |
+: 611 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment