diff --git a/lua/entities/gmod_wire_expression2/core/serverinfo.lua b/lua/entities/gmod_wire_expression2/core/serverinfo.lua index 08ecf3ce05..d72616434a 100644 --- a/lua/entities/gmod_wire_expression2/core/serverinfo.lua +++ b/lua/entities/gmod_wire_expression2/core/serverinfo.lua @@ -78,3 +78,7 @@ end e2function number tickInterval() return engine.TickInterval() end + +e2function number tickRate() + return 1 / engine.AbsoluteFrameTime() +end diff --git a/lua/wire/client/e2descriptions.lua b/lua/wire/client/e2descriptions.lua index d2d85c3fe0..a7067124d5 100644 --- a/lua/wire/client/e2descriptions.lua +++ b/lua/wire/client/e2descriptions.lua @@ -976,6 +976,7 @@ E2Helper.Descriptions["printCaption(sn)"] = "Emits a closed caption with the pro -- Time E2Helper.Descriptions["tickClk()"] = "DEPRECATED. Use 'event tick()' instead! Returns 1 if the current execution was caused by \"runOnTick\"" E2Helper.Descriptions["tickInterval()"] = "Returns the time (in seconds) between each server tick" +E2Helper.Descriptions["tickRate()"] = "Returns the current server tickrate. Allows detecting lags" E2Helper.Descriptions["curtime()"] = "Returns the current game time since server-start in seconds" E2Helper.Descriptions["realtime()"] = "Returns the current real time since server-start in seconds" E2Helper.Descriptions["systime()"] = "Returns a highly accurate time (also in seconds) since the server was started. Ideal for benchmarking"