b2dGetFrameTime

Category: 2D Overlay

Syntax:

b2dGetFrameTime:Double()


Parameters

None.



Returns

Double



Summary

Returns the average time a frame takes, in milliseconds.

Takes no parameters.

The average time between one b2dFlip and the next over the last second, in milliseconds (16.7 at 60 FPS). Updated once a second, like b2dGetFPS. Works whether or not the profiler panel is showing.

Useful for adapting to the machine: if frames take too long, draw less.

View detailed documentation online



Example
If b2dGetFrameTime() > 20 Then
    particles = particles / 2   ; struggling - ease off
EndIf

BambooBasic © 2026 Michael Denathorn