CMTimebaseSetTimerDispatchSourceNextFireTime(_:timerSource:fireTime:flags:)
Sets the time on the timebase’s timeline at which the timer dispatch source should fire next.
Declaration
func CMTimebaseSetTimerDispatchSourceNextFireTime(_ timebase: CMTimebase, timerSource: dispatch_source_t, fireTime: CMTime, flags: UInt32) -> OSStatusDiscussion
The timer source you specify must be on the list of timers the timebase manages. The timebase continues to update the timer dispatch source’s start time according to time jumps and effective rate changes. If fireTime is not numeric, or if the timebase is not moving, the function sets start time to DISPATCH_TIME_FOREVER.
Due to the way that timer dispatch sources are implemented, if a timer passes through a state in which it is due to fire, it may fire even if it’s rescheduled before the event handler is run. Clients should take care to avoid temporarily scheduling timers in the past. For example, set the timebase’s rate or time before you set the timer’s next fire time, if you are doing both at once. If setting the timebase’s rate or time might put the timer’s fire time in the past, you may need to set the fire time to kCMTimeInvalid across the timebase change.
See Also
Interacting with Timers
CMTimebaseAddTimer(_:timer:runloop:)CMTimebaseAddTimerDispatchSource(_:timerSource:)CMTimebaseRemoveTimer(_:timer:)CMTimebaseRemoveTimerDispatchSource(_:timerSource:)CMTimebaseSetTimerNextFireTime(_:timer:fireTime:flags:)CMTimebaseSetTimerToFireImmediately(_:timer:)CMTimebaseSetTimerDispatchSourceToFireImmediately(_:timerSource:)