Dev Improvements #4

Merged
omegaleo merged 26 commits from dev into main 2025-12-09 23:55:56 +00:00
Showing only changes of commit 9acc18e1fa - Show all commits
@@ -36,6 +36,25 @@ namespace GameDevLibrary.Helpers
return stopwatch.ElapsedMilliseconds;
}
public static long RecordAndSaveToResults(string key, Action actionToRecord)
{
var stopwatch = new Stopwatch();
stopwatch.Start();
actionToRecord.Invoke();
stopwatch.Stop();
if (!_benchmarks.ContainsKey(key))
{
_benchmarks[key] = new List<long>();
}
_benchmarks[key].Add(stopwatch.ElapsedMilliseconds);
return stopwatch.ElapsedMilliseconds;
}
public static void Start(string key)
{
GetStopwatch(key).Restart();