Private
Public Access
1
0

update perf logs, split OnParticleTick, add throttling

This commit is contained in:
2026-05-24 10:42:23 +02:00
parent 3fca34a009
commit a87825df6d
4 changed files with 96 additions and 34 deletions

View File

@@ -5,7 +5,7 @@ namespace OrekiWoofsBees.Common;
public static class DiagnosticsUtil
{
public static void StopAndLogTime<T>(
public static bool StopAndLogTime<T>(
this Stopwatch stopwatch,
T instance,
double totalSecondsThreshold,
@@ -14,7 +14,11 @@ public static class DiagnosticsUtil
{
stopwatch.Stop();
if (stopwatch.Elapsed.TotalSeconds >= totalSecondsThreshold)
{
instance.Mod?.Logger.Warning($"{typeof(T).Name}.{callerName} ({note}) took {stopwatch.Elapsed.TotalSeconds:F2}s");
return true;
}
return false;
}
public static void LogTime<T>(