Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Frame timing API counter reference

Reference for the FrameTiming API and its corresponding Profiler counters.
Read time 1 minuteLast updated 20 days ago

The following table describes the purpose of the counters that the
FrameTiming
API
provides.

FrameTiming API field

Profiler counter

Description

cpuFrameTime
CPU Total Frame TimeThe total CPU frame time, in nanoseconds. Unity calculates this as the time between the ends of two frames, including any overheads or time spent waiting between frames. This value doesn't include the time that the application is paused with
Application.Pause
.
cpuMainThreadFrameTime
CPU Main Thread Frame TimeActive main thread work time in nanoseconds. This is the PlayerLoop time without the time the main thread was waiting for the VSync or render thread to finish its work, calculated as follows:

cpuMainThreadFrameTime = PlayerLoop - GfxDevice.WaitForRenderThread - Gfx.WaitForPresentOnGfxThread - WaitForTargetFPS
cpuMainThreadPresentWaitTime
N/AThe CPU time in nanoseconds spent waiting for the frame presentation or VSync during the frame, calculated as follows:

cpuMainThreadPresentWaitTime = Gfx.WaitForPresentOnGfxThread + WaitForTargetFPS
.
cpuRenderThreadFrameTime
CPU Render Thread Frame TimeActive Render Thread work time in nanoseconds without Unity calling the
Present()
function, calculated as follows:

cpuRenderThreadFrameTime = RenderLoop - Gfx.PresentFrame
.
gpuFrameTime
GPU Frame TimeThe time difference in nanoseconds between the beginning and the end of the GPU rendering a single frame.
The following diagram visualizes the relationships between FrameTiming and the Profiler frame data.

Diagram showing relation of FrameTiming API to Profiler data

Additional resources