Created
June 29, 2014 19:06
-
-
Save chrislaughlin/d4686e2aa963eb08a68b to your computer and use it in GitHub Desktop.
Increment and Decrement
This file contains hidden or 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 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