2013年10月15日
摘要: 先要引用System.ComponentModelusing System.ComponentModel;然后创建backgroundworker private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { TestArgs args = (TestArgs)e.Argument; MyMethod(args.Content, args.Index); } /// /// background... 阅读全文
posted @ 2013-10-15 20:58 BobLiu 阅读(1515) 评论(0) 推荐(0)
摘要: 先引用Diagnosticsusing System.Diagnostics;然后:Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); 中间放要测试的代码stopWatch.Stop();TimeSpan ts = stopWatch.Elapsed;string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);Debug.Writ 阅读全文
posted @ 2013-10-15 20:43 BobLiu 阅读(407) 评论(0) 推荐(0)