/// <summary>
/// 初始化Timer
/// </summary>
private void IniTimer01()
{
timer01.Interval = 1000;
timer01.Enabled = true;
timer01.AutoReset = true;
timer01.Elapsed += Timer01_Elapsed;
timer01.Start();
}
private void Timer01_Elapsed(object sender, ElapsedEventArgs e)
{
//Invoke同步 BeginInvoke异步
this.Invoke(new Action(() => { label1.Text = DateTime.Now.ToString(); }));
this.BeginInvoke(new Action(() => { label2.Text = DateTime.Now.ToString(); }));
}