Created
September 2, 2013 07:21
-
-
Save avdyushin/6410033 to your computer and use it in GitHub Desktop.
Delayed function call using Grand Central Dispatch
This file contains hidden or 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
| double d = 2.0f; // Delay | |
| dispatch_time_t t = dispatch_time(DISPATCH_TIME_NOW, d * NSEC_PER_SEC); | |
| dispatch_after(t, dispatch_get_main_queue(), ^(void){ | |
| // Call any function | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment