Skip to content

Instantly share code, notes, and snippets.

@chrislaughlin
Created June 29, 2014 19:06
Show Gist options
  • Save chrislaughlin/d4686e2aa963eb08a68b to your computer and use it in GitHub Desktop.
Save chrislaughlin/d4686e2aa963eb08a68b to your computer and use it in GitHub Desktop.
Increment and Decrement
var add = 0;
console.time('add');
for (var i = 0; i < 100; i++) {
add++;
}
console.timeEnd('add');
var sub = 0;
console.time('sub');
for (var i = 0; i < 100; i++) {
sub--;
}
console.timeEnd('sub');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment