From 2f07d2d245f96bfdcdbd25151fb742ca0bfa4eb9 Mon Sep 17 00:00:00 2001 From: shogo4405 Date: Mon, 28 Oct 2024 01:29:55 +0900 Subject: [PATCH] fixed an issue where statistics were not updating as intended. --- Sources/Network/NetworkMonitor.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Network/NetworkMonitor.swift b/Sources/Network/NetworkMonitor.swift index c98ab1ad1..02e744f90 100644 --- a/Sources/Network/NetworkMonitor.swift +++ b/Sources/Network/NetworkMonitor.swift @@ -49,10 +49,10 @@ public final actor NetworkMonitor { currentBytesInPerSecond: currentBytesInPerSecond, currentBytesOutPerSecond: currentBytesOutPerSecond ) - defer { - previousQueueBytesOut.removeFirst() - } if measureInterval <= previousQueueBytesOut.count { + defer { + previousQueueBytesOut.removeFirst() + } var total = 0 for i in 0..