C# System.Timers Demo
2021-05-17 17:28
标签:object tostring dem private led readline set span oid C# System.Timers Demo 标签:object tostring dem private led readline set span oid 原文地址:https://www.cnblogs.com/Fred1987/p/11770341.htmlstatic 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")}");
}