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

print(FrameTime())
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 2
Generate Html 3
SaveChanges (1) 16
Render Body 0
Render Sidebar 12