Skip to content

Instantly share code, notes, and snippets.

@MMercieca
Created November 20, 2015 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MMercieca/f1f82168bb880f759796 to your computer and use it in GitHub Desktop.
Save MMercieca/f1f82168bb880f759796 to your computer and use it in GitHub Desktop.
func updateIntervals
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