title: Xamarin Forms Best way to run a background thread
body: <p>I have a question. I am building an app that collects stock market prices, but now the most important part is where I do a call every x seconds to get the new price. The variable of the price is located in the App.xaml.cs, so it is global for every page, but now I need to update it with the following line every 3 seconds: <code>CoinList = await RestService.GetCoins();</code></p>
  
  <p>The function must be async because the whole RestService is async!</p>
  
  <p>I already found something like this:</p>
  
  <pre><code>var minutes = TimeSpan.FromMinutes (3); 
  
  Device.StartTimer (minutes, () =&gt; {
  
      // call your method to check for notifications here
  
      // Returning true means you want to repeat this timer
      return true;
  });
  </code></pre>
  
  <p>But I don't know if this is the best way to do it and where I should put it, because it is the most essential part of my app!</p>
  
  <p>Any suggestions?</p>