C# System.Timers Demo
static void Main(string[] args) { SystemTimersDemo(); Console.ReadLine(); } static void SystemTimersDemo() { System.Timers.Timer timer = new System.Timers.Timer(1000); timer.Elapsed += Timer_Elapsed; timer.AutoReset = true; timer.Enabled = true; } private static void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { Console.WriteLine($"The Elapsed event was raised at {e.SignalTime.ToString("yyyyMMddHHmmssffff")}"); }