Created
September 3, 2016 01:10
-
-
Save fdocr/a2553d6700215bce42623284e6cc8cc4 to your computer and use it in GitHub Desktop.
Delay function in ms
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
// Delay function expressed in ms | |
func delay(delay:Double, closure:()->()) { | |
dispatch_after( | |
dispatch_time( | |
DISPATCH_TIME_NOW, | |
Int64(delay * 1000000.0) | |
), | |
dispatch_get_main_queue(), closure) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment