Last active
October 18, 2017 22:45
-
-
Save alwold/52804b8e9de187bd43b1cbd341e22195 to your computer and use it in GitHub Desktop.
Dispatch timer
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
let source = DispatchSource.makeTimerSource() | |
source.setEventHandler { | |
NSLog("hello world") | |
} | |
source.schedule(deadline: .now(), repeating: .seconds(2)) | |
source.resume() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment