Converts a host time from native units to CMTime.


func CMClockMakeHostTimeFromSystemUnits(_ hostTime: UInt64) -> CMTime


The returned value will have a large integer timescale (eg, nanoseconds). This function handles situations where host time's native units use a non-integer timescale. In macOS, this function converts from the units of mach_absolute_time.

See Also

Accessing and Converting Time

func CMClockGetTime(CMClock) -> CMTime

Retrieves the current time from a clock.

func CMClockGetAnchorTime(CMClock, clockTimeOut: UnsafeMutablePointer<CMTime>, referenceClockTimeOut: UnsafeMutablePointer<CMTime>) -> OSStatus

Retrieves the current time from a clock and also the matching time from the clock's reference clock.

func CMClockConvertHostTimeToSystemUnits(CMTime) -> UInt64

Converts a host time from CMTime to the host time's native units.