Garry's Mod Wiki

Garry's Mod Wiki

  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

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...