C#代码里面计算代码运行时间方法:
DateTime timeBegin = DateTime.Now;
{
{
...//处理语句,一句代码也好,多条语句也行
}
DateTime timeEnd= DateTime.Now;
TimeSpan span = timeEnd- timeBegin;
double seconds = span.TotalSeconds;
DateTime timeEnd= DateTime.Now;
TimeSpan span = timeEnd- timeBegin;
double seconds = span.TotalSeconds;