title: C# UWP UI dispatcher optimization (Windows IoT Core)
body: <p>In my app (on a Dragonboard 410c) i have a ThreadPoolTimer. Inside the Tick-Event is a lot of work to do, most work is for processing data and update the UI. So i added a dispatcher inside the Tick-Event and process all the work there. Since the Tick-Event is called every second (Need this for updating a clock on the UI), some UI animations are sort of lagging a bit every second. As soon as i remove the the option to update the clock on the UI, all animations are running smooth.</p>
  
  <pre><code>private async void clock_Tick(ThreadPoolTimer timer)
  {
      await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
      () =&gt;
      {
          textBlockClock.Text = DateTime.Now.ToString("HH:mm");
          textBlockWeekDay.Text = DateTime.Now.ToString("dddd", cultureInfo);
          textBlockDate.Text = DateTime.Now.ToString("dd.MM.yyyy");
  
          // Do more work (call multiple methods and tasks)
      });
  </code></pre>
  
  <p>So the question is, is it the right approach to use just one dispatcher and add every related code in there, or should i use the dispatcher inside every called method / task for better optimization?</p>