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

Page Links


Special Pages


Wikis

?

Render Time: 36ms

DB GetPage 3
Generate Html 7
SaveChanges (1) 11
Render Body 0
Render Sidebar 12