Skip to content

Instantly share code, notes, and snippets.

@stephanschubert
Created March 19, 2010 10:22
Show Gist options
  • Save stephanschubert/337399 to your computer and use it in GitHub Desktop.
Save stephanschubert/337399 to your computer and use it in GitHub Desktop.
function t(f) { var x = (new Date()).getTime(); f.call(); return (new Date()).getTime() - x; }
t(function() { for(i = 0; i < 1000000; ++i) { Math.ceil(i); } });
// 1081
t(function() { for(i = 0; i < 1000000; ++i) { ~~i; } });
// 772
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment