Created
May 2, 2015 19:34
-
-
Save ivan3bx/a6f54400066e079454cb to your computer and use it in GitHub Desktop.
Some throwaway code that invalidates an NSTimer, and create a new one for a pseudo-random timeout.
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
self.timer.invalidate() | |
let value = ((Float((random()&1000)) / 100) % 5) + 0.4 | |
let rndTimeout = NSTimeInterval(value) | |
self.timer = NSTimer.scheduledTimerWithTimeInterval(rndTimeout, target: self, selector: Selector("showActivity:"), userInfo: nil, repeats: true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment