update perf logs, split OnParticleTick, add throttling
This commit is contained in:
@@ -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>(
|
||||
|
||||
Reference in New Issue
Block a user