Contents

CMTimeCompare(_:_:)

Returns the numerical relationship of two times.

Declaration

func CMTimeCompare(_ time1: CMTime, _ time2: CMTime) -> Int32

Parameters

  • time1:

    A time to compare.

  • time2:

    Another time to compare.

Return Value

A numeric value that indicates the relative order of the times.

Discussion

This method returns the following values depending on the relationship of the time values:

  • If time1 is less than time2, it returns -1.

  • If time1 is greater than time2, it returns 1.

  • If time1 and time2 are equal, it returns 0.

To sort numeric and nonnumeric times consistently, this call uses the following sort rules:

-infinity < all finite values < indefinite < +infinity < invalid

Times with numerically larger epochs are greater than those with smaller epochs. ``

See Also

Comparing Times