From 221a0f134148914ccaff159e60fbc1859fef5924 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Wed, 13 Jul 2022 07:44:05 +0300 Subject: [PATCH] Removed workaround from headless platform memory measurement code --- samples/ControlCatalog.NetCore/Program.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/samples/ControlCatalog.NetCore/Program.cs b/samples/ControlCatalog.NetCore/Program.cs index 07d514df6b..cfa016d814 100644 --- a/samples/ControlCatalog.NetCore/Program.cs +++ b/samples/ControlCatalog.NetCore/Program.cs @@ -60,12 +60,6 @@ namespace ControlCatalog.NetCore }) .AfterSetup(_ => { - static Task LowPriorityDelay(int ms) - { - return Task.Delay(ms).ContinueWith(_ => - Dispatcher.UIThread.InvokeAsync(() => { }, DispatcherPriority.Background)) - .Unwrap(); - } DispatcherTimer.RunOnce(async () => { var window = ((IClassicDesktopStyleApplicationLifetime)Application.Current.ApplicationLifetime) @@ -77,7 +71,7 @@ namespace ControlCatalog.NetCore continue; Console.WriteLine("Selecting " + page.Header); tc.SelectedItem = page; - await LowPriorityDelay(20); + await Task.Delay(50); } Console.WriteLine("Selecting the first page"); tc.SelectedItem = tc.Items.OfType().First(); @@ -86,7 +80,7 @@ namespace ControlCatalog.NetCore for (var c = 0; c < 3; c++) { GC.Collect(2, GCCollectionMode.Forced); - await Task.Delay(00); + await Task.Delay(50); } void FormatMem(string metric, long bytes)