class Program { static System.Timers.Timer Timer1 = new Sys

时间:2021-11-07 07:33:18


class Program {

static System.Timers.Timer Timer1 = new System.Timers.Timer();

static void Main() {

Timer1.Interval = 1000;

Timer1.Elapsed += new ElapsedEventHandler(PeriodicTaskHandler);

Timer1.Start();

Console.ReadLine();

}

static void PeriodicTaskHandler(object sender, ElapsedEventArgs e) {

string str =Thread.CurrentThread.ManagedThreadId.ToString()+”##” +”Timer1″ +”##” + e.SignalTime.ToLongTimeString();

Console.WriteLine(str);

}

}

除声明外,跑步客文章均为原创,,转载请以链接形式标明本文地点
  

本文地点:  






相关内容

class Program { static System.Timers.Timer Timer1 = new Sys

操作TaskManager爬取2万条代办代理IP实现自动投票成果