Garry's Mod Wiki

FrameTime

  number FrameTime()

Description

Returns the CurTime-based time in seconds it took to render the last frame.

This should be used for frame/tick based timing, such as movement prediction or animations.

For real-time-based frame time that isn't affected by host_timescale, use RealFrameTime. RealFrameTime is more suited for things like GUIs or HUDs.

Returns

1 number
time (in seconds)

Example

Print the frame time

Output: 0.014999999664724

Example

Get the servers/clients tickrate/fps

print( "Tick: " .. ( 1 / FrameTime() ) )
Output: Tick: 66.666668156783