Example #1
0
        private async Task PerformanceWatcher()
        {
            Stopwatch sw = new Stopwatch();

            while (this._contentLoaded)
            {
                await Task.Delay(500);

                sw.Restart();
                await Dispatch.MainThread();

                await Task.Delay(16);

                await Dispatch.MainThread();

                long ms = sw.ElapsedMilliseconds;

                if (ms > 50)
                {
                    Log.Warning($"UI thread took {ms}ms to tick");
                }
            }
        }