From 0604a27efb1a11b6612d1d5c9854496879e494f9 Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Sat, 30 Apr 2022 12:54:34 -0300 Subject: [PATCH] added performance counter for think hook --- Barotrauma/BarotraumaClient/ClientSource/GameMain.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs b/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs index 252bbb5ad..24eb0b03b 100644 --- a/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs +++ b/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs @@ -924,9 +924,17 @@ namespace Barotrauma SoundManager?.Update(); + Stopwatch luaSw = new Stopwatch(); + + luaSw.Start(); + GameMain.LuaCs.Update(); GameMain.LuaCs.Hook.Call("think"); + luaSw.Stop(); + PerformanceCounter.AddElapsedTicks("Think Hook", luaSw.ElapsedTicks); + + Timing.Accumulator -= Timing.Step; updateCount++;