Get frame timing data
Get frame time data with a custom Profiler module, or using the FrameTimingManager API.
Read time 2 minutesLast updated 20 days ago
You can get frame timing data from the API in the following ways:
FrameTimingTo get frame timing data from release builds, you must first enable the Frame Timing Stats property.
Use a custom Profiler module
To view frame timing data in a custom Profiler module perform the following steps:
- Create a custom profiler module according to the instructions on Creating a custom profiler module.
- Open the Profiler window (Window > Analysis > Profiler)
- Open the Profiler Module Editor (Profler Modules dropdown > gear icon) and select your custom Profiler module.
- In the Available Counters panel, select Unity.
- Select Render to open the submenu that contains Profiler counters related to memory usage, which includes those that the property enables. You can then click on the relevant counters in the submenu to add them to your custom module.
FrameTimingStats
For a list of available counters, refer to Profiler counters reference.
The Highlights Profiler module uses to determine whether a frame is CPU or GPU bound.
FrameTimingUse the FrameTiming API
Use the API to access timestamp information. In each variable, records the time a specific event happens during a frame.
FrameTimingFrameTimingManagerThe following table contains the values available through the API, in the order that Unity executes them during a frame:
Property | Description |
|---|---|
| The CPU timestamp time when the frame begins. |
| The CPU timestamp time when Unity submits the first job to the GPU during this frame. |
| The CPU timestamp time when Unity calls the Present() function for the current frame. |
| The CPU timestamp time when the GPU finishes rendering the frame and interrupts the CPU. |
Use API to convert the timestamp to seconds.
FrameTimingManager.GetCpuTimerFrequency