怎么样测试程序运行所需时间

 Stopwatch stopwatch = new Stopwatch();
 stopwatch.Start();

。。。。。中间代码。。。

stopwatch.Stop();
long result = stopwatch.ElapsedMilliseconds;sqlBulkCopy.Close();

result  为所需时间,单位毫秒
posted @ 2012-04-22 17:35  VipSoft  阅读(197)  评论(0编辑  收藏  举报