itemTime(forHostTime:)
Converts a host time, specified in seconds, to the item’s timebase.
Declaration
func itemTime(forHostTime hostTimeInSeconds: CFTimeInterval) -> CMTimeParameters
- hostTimeInSeconds:
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.
Discussion
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.