From 5dc8ac194a0a8c2a9a8c29e110497fa1e05ae98e Mon Sep 17 00:00:00 2001 From: OudomMunint Date: Sun, 7 Jul 2024 02:14:03 +1000 Subject: [PATCH] Manage system load during specs gathering --- Program.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Program.cs b/Program.cs index 095182c..5c684cc 100644 --- a/Program.cs +++ b/Program.cs @@ -91,7 +91,7 @@ static void DisplayWindowsInfo() ConsoleSpinner.Stop(); } - static void DisplayCpuInfo() + static async void DisplayCpuInfo() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { @@ -156,11 +156,12 @@ static void DisplayCpuInfo() { Console.WriteLine("An error occurred while retrieving CPU information: " + ex.Message); } + await Task.Delay(500); } } } - static void DisplayRamInfo() + static async void DisplayRamInfo() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { @@ -213,10 +214,11 @@ static void DisplayRamInfo() { Console.WriteLine("An error occurred while retrieving memory information: " + ex.Message); } + await Task.Delay(500); } } - static void DisplayGpuInfo() + static async void DisplayGpuInfo() { try { @@ -375,6 +377,7 @@ static void DisplayGpuInfo() { Console.WriteLine("An error occurred while retrieving GPU information: " + ex.Message); } + await Task.Delay(500); } static void RunBenchmark()