Fix error in download speed throttle (#1242)

This commit is contained in:
Mbucari 2025-05-06 14:48:40 -06:00 committed by GitHub
parent ace3d80e41
commit 0e987eef00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -277,11 +277,11 @@ namespace AaxDecrypter
if (SpeedLimit >= MIN_BYTES_PER_SECOND && bytesReadSinceThrottle > SpeedLimit / THROTTLE_FREQUENCY)
{
var delayMS = (int)(startTime.AddSeconds(1d / THROTTLE_FREQUENCY) - DateTime.Now).TotalMilliseconds;
var delayMS = (int)(startTime.AddSeconds(1d / THROTTLE_FREQUENCY) - DateTime.UtcNow).TotalMilliseconds;
if (delayMS > 0)
await Task.Delay(delayMS, _cancellationSource.Token);
startTime = DateTime.Now;
startTime = DateTime.UtcNow;
bytesReadSinceThrottle = 0;
}