Skip to content

Instantly share code, notes, and snippets.

@medikoo
Created March 2, 2010 13:53
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 medikoo/319516 to your computer and use it in GitHub Desktop.
Save medikoo/319516 to your computer and use it in GitHub Desktop.
Firefox quirk
/**
* First loop will run few hundred times slower
*/
var i, limit = 100000;
var time = +new Date;
for (i = 0; true; ++i) {
if (i > limit) {
break;
}
}
document.write("1. time: " + (new Date - time));
time = +new Date;
for (i = 0; 1 < 2; ++i) {
if (i > limit) {
break;
}
}
document.write("<br />2. time: " + (new Date - time));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment