The time value associated with the next frame that was displayed.
- iOS 10.0+
- Mac Catalyst 13.0+
- tvOS 10.0+
- Core Animation
You can use the target timestamp to cancel or pause long running processes that may overrun the available time between frames in order to maintain a consistent frame rate.
The following code shows how you can create a display link and register it with a run loop. The
display function attempts to sum the square roots of all numbers up to
max, but with each iteration checks the current time (
CACurrent) against the
target. If the time taken to complete the calculation is later than the target timestamp, the function breaks the loop: