diff options
Diffstat (limited to 'src/SMAPI/Framework/PerformanceCounter/PerformanceCounterManager.cs')
-rw-r--r-- | src/SMAPI/Framework/PerformanceCounter/PerformanceCounterManager.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/PerformanceCounter/PerformanceCounterManager.cs b/src/SMAPI/Framework/PerformanceCounter/PerformanceCounterManager.cs index e2200e74..ae7258e2 100644 --- a/src/SMAPI/Framework/PerformanceCounter/PerformanceCounterManager.cs +++ b/src/SMAPI/Framework/PerformanceCounter/PerformanceCounterManager.cs @@ -16,6 +16,22 @@ namespace StardewModdingAPI.Framework.PerformanceCounter this.InitializePerformanceCounterEvents(); } + public void Reset() + { + foreach (var performanceCounter in this.PerformanceCounterEvents) + { + this.ResetCategory(performanceCounter); + } + } + + public void ResetCategory(EventPerformanceCounterCategory category) + { + foreach (var eventPerformanceCounter in category.Event.PerformanceCounters) + { + eventPerformanceCounter.Value.Reset(); + } + } + private void InitializePerformanceCounterEvents() { this.PerformanceCounterEvents = new HashSet<EventPerformanceCounterCategory>() |