TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2016 |
SPMSupports SPM | ✗ |
Maintained by Andrew Chun, Comyar Zaheri.
Chronos is a collection of useful Grand Central Dispatch utilities. If you have any specific requests or ideas for new utilities, don’t hesitate to create a new issue.
interval = 2 * count
.” Add the following to your Podfile:
pod 'Chronos-Swift'
import Chronos
var timer = DispatchTimer(interval: 0.25, closure: {
(timer: RepeatingTimer, count: Int) in
println("Execute repeating task here")
})
/** Starting the timer */
timer.start(true) // Fires timer immediately
/** Pausing the timer */
timer.pause()
/** Permanently canceling the timer */
timer.cancel()
import Chronos
var variableTimer: VariableTimer = VariableTimer(closure: {
(timer: RepeatingTimer, count: Int) -> Void in
println("Execute repeating task here")
}) {(timer: VariableTimer, count: Int) -> Double in
return Double(2 * count) // Return interval according to function
}
/** Starting the timer */
timer.start(true) // Fires timer immediately
/** Pausing the timer */
timer.pause()
/** Permanently canceling the timer */
timer.cancel()
Chronos is available under the MIT License.