FrameTime

From Garry's Mod
Jump to: navigation, search
 FrameTime( )

Contents

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

number

time (in seconds)

Examples

Example

Print the frame time

print(FrameTime())

Output:

0.014999999664724

Examples

Example

Get the servers/clients tickrate/fps

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

Output:

Tick: 66.666668156783
Personal tools
Navigation