Frame timing manager introduction
Learn about how the Frame Timing Manager works, and which platforms it supports.
Read time 3 minutesLast updated 19 days ago
You can use the class to capture high level timing data about individual frame performance in an application. You can then use this data to assess whether your application meets performance targets.
FrameTimingManagerYou can use the class in the following situations:
FrameTimingManager- You need to monitor performance at a frame-by-frame level.
- Your application uses the Dynamic Resolution feature.
- Your application uses Adaptive Performance.
Frame timings don't replace data from the Profiler. After you record high level metrics of your application with , you can use the Profiler to then investigate specific details.
FrameTimingManagerTo use the data you collect from refer to Get frame timing data.
FrameTimingManagerFrameTimingManager data availability
FrameTimingManager- CPU timing results aren't immediately available at the end of each frame.
- Unity reads GPU timing results with three frames delay.
For a detailed description of available timings, refer to Get frame timing data.
FrameTimingMangerFrameTimeComplete- If the GPU supports GPU timestamps, the GPU provides a timestamp.
FrameTimeComplete - If the GPU doesn't support GPU timestamps but returns a GPU time, calculates a value for
FrameTimingManager. The value is the sum of the reported GPU time and thegpuFrameTimevalues.FirstSubmitTimestamp - If the GPU doesn't support GPU timestamps and doesn't return GPU time, sets the value of
FrameTimingManageras the value ofPresentTimestamp.FrameTimeComplete
Player pause behavior
FrameTimingManagerApplication.PausecpuFrameTimePlatform support
FrameTimingManagerPlatform | Graphics | Supported |
|---|---|---|
| Android | OpenGL ES | Yes |
| Android | Vulkan | Yes |
| iOS | Metal | Yes |
| Linux | OpenGL | Partial: GPU Frame Time measurement is unsupported. |
| Linux | Vulkan | Yes |
| macOS | Metal | Yes |
| tvOS | Metal | Yes |
| WebGL | WebGL | Partial: GPU Frame Time measurement is unsupported. |
| Windows | DirectX 11 | Yes |
| Windows | DirectX 12 | Yes |
| Windows | OpenGL | Yes |
| Windows | Vulkan | Yes |
| XR | OpenGL ES | Partial: CPU Render Thread Frame Time and GPU Frame Time measurement is unsupported. |
| XR | Vulkan | Partial: CPU Render Thread Frame Time and GPU Frame Time measurement is unsupported. |
Compatibility with tile-based deferred rendering GPUs
For GPUs that use tile-based deferred rendering architecture, such as Metal GPUs in Apple devices, the reported GPU time might be larger than the reported frame time.
This can happen when the GPU is under heavy load, or when the GPU pipeline is full. In these cases, the GPU might defer execution of some rendering phases. Because measures the time between the beginning and end of the frame rendering, any gaps between phases increase the reported GPU time.
FrameTimingManagerIn the following example, no GPU resources are available, because the GPU passes a job from the vertex queue to the fragment queue. The GPU's graphics API therefore defers the execution of the next phase. When this happens, the GPU time measurement includes phase work time and any gap in between. The result is that reports a higher GPU time measurement than expected.
FrameTimingManager
Diagram showing how the discrepancy in reported GPU time can happen in the Metal API