摘要:
System.Diagnostics.Stopwatch watch = new Stopwatch(); watch.Start(); // 开始监视代码运行时间 //需要监测的代码 dothing.... watch.Stop(); // 停止监视 TimeSpan timespan = watch.Elapsed; // 获取当前实例测量得出的总时间 string hours = t... 阅读全文
摘要:
private void button1_Click(object sender, EventArgs e) { Task t1 = Task.Factory.StartNew(() => k1()); Task t2 = Task.Factory.StartNew(() => k2()); } ... 阅读全文