From 1a5f471e1524a7592a7458fdf330ac77141dc47c Mon Sep 17 00:00:00 2001 From: nilaoda Date: Tue, 30 May 2023 09:44:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=9F=E5=BA=A6=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBDown/ProgressBar.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BBDown/ProgressBar.cs b/BBDown/ProgressBar.cs index e32235e1b..c31047bb2 100644 --- a/BBDown/ProgressBar.cs +++ b/BBDown/ProgressBar.cs @@ -55,19 +55,19 @@ public void Report(double value, long bytesCount) Interlocked.Exchange(ref downloadedBytes, bytesCount); } - private void SpeedTimerHandler(object? state) - { - lock (speedTimer) + private void SpeedTimerHandler(object? state) + { + lock (speedTimer) { if (disposed) return; - if (downloadedBytes > 0) + if (downloadedBytes > 0 && downloadedBytes - lastDownloadedBytes > 0) { speedString = " - " + BBDownUtil.FormatFileSize(downloadedBytes - lastDownloadedBytes) + "/s"; lastDownloadedBytes = downloadedBytes; } } - } + } private void TimerHandler(object? state) {