Skip to content

Instantly share code, notes, and snippets.

@arestov
Created June 17, 2010 09:30
Show Gist options
  • Save arestov/441901 to your computer and use it in GitHub Desktop.
Save arestov/441901 to your computer and use it in GitHub Desktop.
var za = 'DIV';
var hey = function(){return false}
var t1 = (new Date()).getTime() ;
for (var i=0; i < 100000; i++) {
if (!!za.match(/^a$/i)){
hey()
};
};
var t11 = (new Date()).getTime() ;
console.log(t11 - t1);
var t2 = (new Date()).getTime() ;
for (var i=0; i < 100000; i++) {
if (za.toLowerCase() == 'a'){hey()}
};
var t22 = (new Date()).getTime() ;
console.log(t22 - t2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment