Created
January 27, 2016 03:53
-
-
Save correia/68c75e449cdd1c4943dc 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
// What does this program print? | |
import Foundation | |
for (var i = 0; i < 5; i++) { | |
let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(1 * Double(NSEC_PER_SEC))) | |
dispatch_after(delayTime, dispatch_get_main_queue()) { | |
print(i) | |
} | |
} | |
NSRunLoop.currentRunLoop().runUntilDate(NSDate(timeIntervalSinceNow: 5.0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment