b2dGetGPUTime

Category: 2D Overlay

Syntax:

b2dGetGPUTime:Double()


Parameters

None.



Returns

Double



Summary

Returns the average time the GPU spends on a frame, in milliseconds (-1 if it isn't known yet).

Takes no parameters.

The time the graphics card spends drawing each frame, averaged over the last second. It is measured with Vulkan GPU timestamps. Returns -1 until the first second's figure is in, or if the GPU can't be timed.

If the GPU time is close to the frame time, the graphics card is the bottleneck (too many pixels, heavy shaders); if the CPU time is, your program's own code is.

View detailed documentation online



Example
Print "GPU: " & ToString(b2dGetGPUTime()) & " ms"

BambooBasic © 2026 Michael Denathorn