Created
June 5, 2014 04:24
-
-
Save owensd/1e7ff6bd63906b4f7e67 to your computer and use it in GitHub Desktop.
This file contains 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
func testLoopOneMillionTimesA() { | |
var count = 0 | |
self.measureBlock() { | |
count = 0 | |
for _ in 0..1000000 { | |
++count | |
} | |
} | |
} | |
func testLoopOneMillionTimesB() { | |
var count = 0 | |
self.measureBlock() { | |
count = 0 | |
for (var i = 0; i < 1000000; ++i) { | |
++count | |
} | |
} | |
} | |
func testLoopOneMillionTimesC() { | |
var count = 0 | |
self.measureBlock() { | |
count = 0 | |
for (var i = 0; i < 1000000; ++i) { | |
count = count + 1 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment