diff --git a/v2rayN/ServiceLib/Services/SpeedtestService.cs b/v2rayN/ServiceLib/Services/SpeedtestService.cs index f8cdf5f4..46cba129 100644 --- a/v2rayN/ServiceLib/Services/SpeedtestService.cs +++ b/v2rayN/ServiceLib/Services/SpeedtestService.cs @@ -337,6 +337,7 @@ public class SpeedtestService(Config config, Func updateF { using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); await clientSocket.ConnectAsync(endPoint, cts.Token).ConfigureAwait(false); + responseTime = (int)timer.ElapsedMilliseconds; } catch (OperationCanceledException) { @@ -344,7 +345,6 @@ public class SpeedtestService(Config config, Func updateF finally { timer.Stop(); - responseTime = (int)timer.Elapsed.TotalMilliseconds; } return responseTime; }