c#中Stopwatch计时器的使用
private void button3_Click(object sender, EventArgs e) { Stopwatch sw = new Stopwatch(); sw.Start(); Thread.Sleep(3000); sw.Stop(); MessageBox.Show(sw.ElapsedMilliseconds.ToString()); sw.Start(); Thread.Sleep(3000); sw.Stop(); MessageBox.Show(sw.ElapsedMilliseconds.ToString()); }