static void Main() { Action action = () => Console.WriteLine(DateTime.Now); Timer timer = new Timer(5, 1000, action); timer.Start(); }
static void Main() { Timer timer = new Timer(4, 1000); timer.Elapsed += timer_Elapsed; timer.Start(); }
public static void Main() { var timer = new Timer(seconds: 1, method: Print); timer.Start(seconds: 5); }
static void Main() { Timer t = new Timer(1); t.Method += Test; t.Start("Hi there!"); }