Fix
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run

This commit is contained in:
2dust 2025-11-24 19:12:49 +08:00
parent 830dc89c32
commit 386209b835

View file

@ -337,6 +337,7 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
{ {
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
await clientSocket.ConnectAsync(endPoint, cts.Token).ConfigureAwait(false); await clientSocket.ConnectAsync(endPoint, cts.Token).ConfigureAwait(false);
responseTime = (int)timer.ElapsedMilliseconds;
} }
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
@ -344,7 +345,6 @@ public class SpeedtestService(Config config, Func<SpeedTestResult, Task> updateF
finally finally
{ {
timer.Stop(); timer.Stop();
responseTime = (int)timer.Elapsed.TotalMilliseconds;
} }
return responseTime; return responseTime;
} }