Instantly share code, notes, and snippets.

Embed
What would you like to do?
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