how do I measure frame rate
Asked on 2024-07-30
1 search
To measure frame rate, you can use various tools and techniques depending on the platform and context of your application. Here are some relevant insights from the WWDC sessions:
-
WebXR Frame Loop:
- In the context of WebXR, you can measure frame rate by using the
requestAnimationFramemethod, which is synced to the WebXR display rather than the window. This method helps establish a frame loop by immediately requesting the next frame to call the function again. This is discussed in the session Build immersive web experiences with WebXR.
- In the context of WebXR, you can measure frame rate by using the
-
Metal and VisionOS:
- For applications using Metal on visionOS, you can track the frame timeline and various timings such as optimal input time, rendering deadline, and presentation time. This helps in understanding the performance and frame rate of your application. This is covered in the session Render Metal with passthrough in visionOS.
-
General Performance Metrics:
- For general performance metrics, including frame rate, you can use tools like Instruments in Xcode. These tools allow you to profile your application and measure various performance metrics, including frame rate. This is mentioned in the session Explore Swift performance.
-
3D Asset Optimization:
- When optimizing 3D assets for spatial computing, it's important to consider the GPU workload and frame times, especially for immersive applications. Testing early and often is recommended to ensure optimal performance. This is discussed in the session Optimize your 3D assets for spatial computing.
Relevant Sessions
- Build immersive web experiences with WebXR
- Render Metal with passthrough in visionOS
- Explore Swift performance
- Optimize your 3D assets for spatial computing
These sessions provide a comprehensive overview of how to measure and optimize frame rate across different platforms and contexts.

Port advanced games to Apple platforms
Discover how simple it can be to reach players on Apple platforms worldwide. We’ll show you how to evaluate your Windows executable on Apple silicon, start your game port with code samples, convert your shader code to Metal, and bring your game to Mac, iPhone, and iPad. Explore enhanced Metal tools that understand HLSL shaders to validate, debug, and profile your ported shaders on Metal.

Bring your iOS or iPadOS game to visionOS
Discover how to transform your iOS or iPadOS game into a uniquely visionOS experience. Increase the immersion (and fun factor!) with a 3D frame or an immersive background. And invite players further into your world by adding depth to the window with stereoscopy or head tracking.

Optimize your 3D assets for spatial computing
Dive into an end-to-end workflow for optimized 3D asset creation. Discover best practices for optimizing meshes, materials, and textures in your digital content creation tool. Learn how to harness shader graph, baking, and material instances to enhance your 3D scene while optimizing performance. Take advantage of native tools to work more effectively with your assets and improve your app’s performance.
