1 引用类库:
using System.Diagnostics;
2 执行方法:
Stopwatch sw = Stopwatch.StartNew(); //初始化,并且开始计时 Invoke(new Action(() => { textBox1.Text = s; })); MessageBox.Show(sw.ElapsedMilliseconds.ToString()); //显示执行时间
1 引用类库:
using System.Diagnostics;
2 执行方法:
Stopwatch sw = Stopwatch.StartNew(); //初始化,并且开始计时 Invoke(new Action(() => { textBox1.Text = s; })); MessageBox.Show(sw.ElapsedMilliseconds.ToString()); //显示执行时间