Skip to content

Instantly share code, notes, and snippets.

@owensd
Created June 5, 2014 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owensd/1e7ff6bd63906b4f7e67 to your computer and use it in GitHub Desktop.
Save owensd/1e7ff6bd63906b4f7e67 to your computer and use it in GitHub Desktop.
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