public static void Main(string[] args) { AsyncTimer first = new AsyncTimer(SaySomething, 10, 1000); first.StartTimer(); AsyncTimer second = new AsyncTimer(SaySomethingAgain, 10, 1000); second.StartTimer(); Console.WriteLine("work"); }
static void Main() { AsyncTimer asyncTimer = new AsyncTimer(PrintTime, 10, 2000); Task startTimer = asyncTimer.StartTimer(); Console.WriteLine("The task is completing, spam here: "); while (startTimer.IsCompleted == false) { Console.ReadLine(); } Console.WriteLine("The task has been completed!"); }