C# 计算代码运行时间

Stopwatch watch = new Stopwatch();
watch.Start();
int num = myhelper.MySQLExecuteNonQuery(comlist);
watch.Stop();
string time = watch.ElapsedMilliseconds.ToString(); //获取当前实例测量得出的总运行时间(以毫秒为单位)

posted @ 2013-10-16 19:05  宁静.致远  阅读(271)  评论(0编辑  收藏  举报