I am about to develop a console application that will be required to continually run and carry out work at specific times.
My question is what is are best methods or
Create a Task and then Wait it.
class Program
{
static void Main(string[] args)
{
var processTask = Process();
processTask.Wait();
}
private static async Task Process()
{
var isNotCancelled = true;
while (isNotCancelled)
{
//Polling time here
await Task.Delay(1000);
//TODO: Do work here and listen for cancel
Console.WriteLine("I did some work...");
}
}
}