From 509d35d103a9a9edc8e75ff308fac1ef9ef4280d Mon Sep 17 00:00:00 2001 From: Xian55 <367101+Xian55@users.noreply.github.com> Date: Mon, 3 Jul 2023 12:01:17 +0200 Subject: [PATCH] Core: AddonReader: Reduce maximum sample size for timing. --- Core/Addon/AddonReader.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/Addon/AddonReader.cs b/Core/Addon/AddonReader.cs index 3044190b..611f29a1 100644 --- a/Core/Addon/AddonReader.cs +++ b/Core/Addon/AddonReader.cs @@ -70,7 +70,7 @@ public void Update() FullReset(); return; } - else if (updateIndex >= 512) + else if (updateIndex >= 8) { updateSum = 0; updateIndex = 0; @@ -81,7 +81,6 @@ public void Update() updateSum += (DateTime.UtcNow - lastUpdate).TotalMilliseconds; updateIndex++; AvgUpdateLatency = updateSum / updateIndex; - lastUpdate = DateTime.UtcNow; IAddonDataProvider reader = this.reader; @@ -110,6 +109,8 @@ public void Update() : string.Empty; } + lastUpdate = DateTime.UtcNow; + resetEvent.Set(); }