Created
November 20, 2015 20:44
-
-
Save MMercieca/f1f82168bb880f759796 to your computer and use it in GitHub Desktop.
func updateIntervals
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
func updateIntervals() { | |
let now = NSDate() | |
let thisSlice = now.timeIntervalSinceDate(lastUpdate) | |
updateProgress(thisSlice) | |
ellapsedTime += thisSlice | |
if ellapsedTime >= nextAlarmTime { | |
alert() | |
} | |
lastUpdate = now | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment