Search code examples
iphoneiosipadanimationcalayer

Display the framerate (FPS) of a CALayer Animation


I've been creating a (fairly) simple CALayer animation on iPad and it's not quite as smooth as I would have liked. In order to see if my attempts at optimisation are working, I'd like to display or output to the console the framerate ( number of frames a seconds that the system has managed to draw). This feature is commonly found in game engines.

Is this possible with a CALayer animation?


Solution

  • You can use Instruments for that—instead of Run, go to Profile, and there you can choose OpenGL ES Driver. enter image description here

    You can watch the WWDC Session 238 - iOS App Performance: Graphics and Animations, it will give you a great understanding of what and how you can improve in your animations.