Instance Method


Converts a host time, specified in seconds, to the item’s timebase.


func itemTime(forHostTime hostTimeInSeconds: CFTimeInterval) -> CMTime



A host time value, specified in seconds. For example, you might specify the time value returned by the CACurrentMediaTime() function or the timestamp from a CADisplayLink object for this parameter.

Return Value

The equivalent time in the item’s timebase.


The timestamp associated with a CADisplayLink object represents the time of the most recent screen refresh, which is usually a time in the past. If you want to find the time associated with the next screen refresh, you need to increment the timestamp by the value in the display link’s duration property.

See Also

Converting Time Information

func itemTime(forMachAbsoluteTime: Int64) -> CMTime

Converts a Mach host time to the item’s timebase.

func itemTime(for: CVTimeStamp) -> CMTime

Converts a Core Video timestamp to the item’s timebase.