From c909ce2cc1b5d82450e98da268470374db06e3b8 Mon Sep 17 00:00:00 2001 From: Le Chau Date: Thu, 25 Jun 2020 09:48:09 +0700 Subject: [PATCH] =?UTF-8?q?SmallRefactor:=20T=C3=A1ch=20khai=20b=C3=A1o=20?= =?UTF-8?q?v=C3=A0=20kh=E1=BB=9Fi=20t=E1=BA=A1o=20thrStatistics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AIParkingApplication/Statistic.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AIParkingApplication/Statistic.cs b/AIParkingApplication/Statistic.cs index fcd7289..14a6c6e 100644 --- a/AIParkingApplication/Statistic.cs +++ b/AIParkingApplication/Statistic.cs @@ -9,6 +9,7 @@ namespace AIParkingApplication public partial class Statistic : UserControl { private readonly HttpClient client; + private readonly Thread thrStatistics; Label lblLoaiXe; Label lblXeMay; @@ -20,8 +21,8 @@ namespace AIParkingApplication public Statistic(string apiUrl) { InitializeComponent(); - Thread thrStatistics = new Thread(new ThreadStart(GetStatistic)); client = new HttpClient { BaseAddress = new Uri(apiUrl), Timeout = TimeSpan.FromMilliseconds(5000) }; + thrStatistics = new Thread(new ThreadStart(GetStatistic)); thrStatistics.IsBackground = true; thrStatistics.Start(); }