Queries the relative rate of one timebase or clock relative to another timebase or clock and the times of each timebase or clock at which the relative rate went into effect.


func CMSyncGetRelativeRateAndAnchorTime(_ ofClockOrTimebase: CMClockOrTimebase, relativeTo relativeToClockOrTimebase: CMClockOrTimebase, relativeRateOut outRelativeRate: UnsafeMutablePointer<Float64>?, anchorTimeOut outOfClockOrTimebaseAnchorTime: UnsafeMutablePointer<CMTime>?, relativeToAnchorTimeOut outRelativeToClockOrTimebaseAnchorTime: UnsafeMutablePointer<CMTime>?) -> OSStatus


If both have a common master, this calculation is performed purely based on the rates in the common tree rooted in that master. If they have different master clocks (or are both clocks), this calculation takes into account the measured drift between the two clocks, using host time as a pivot. The rate of a moving timebase relative to a stopped timebase is a NaN.

See Also

Utility Functions

func CMClockGetTypeID() -> CFTypeID

Returns the CFTypeID of the CMClock.

func CMClockMightDrift(CMClock, otherClock: CMClock) -> Bool

Returns a Boolean that indicates whether it is possible for two clocks to drift relative to each other.

func CMClockInvalidate(CMClock)

Makes the clock stop functioning.

func CMSyncGetRelativeRate(CMClockOrTimebase, relativeTo: CMClockOrTimebase) -> Float64

Queries the relative rate of one timebase or clock relative to another timebase or clock.

func CMSyncConvertTime(CMTime, from: CMClockOrTimebase, to: CMClockOrTimebase) -> CMTime

Converts a time from one timebase or clock to another timebase or clock.

func CMSyncMightDrift(CMClockOrTimebase, CMClockOrTimebase) -> Bool

Returns a Boolean indicating whether it is possible for one timebase/clock to drift relative to the other.

func CMSyncGetTime(CMClockOrTimebase) -> CMTime

A helper function to get time from a clock or timebase.