Sometimes you need to run some action regularly in certain time intervals. To achieve that in Zebble you can use the Timer class using the following:
Let's say you have an method like below and you want it to run every second:
{
...
await Alert.Toast("Hello! Time is " + DateTime.Now);
}
using Zebble.Services;
...
new Timer(DoSomething, TimeSpan.FromSeconds(1), Timer.WaitingOption.Parallel).Start();
The last parameter of the construction is an enum value of type Waiting option. You can choose from either of the following: