标签:
0.0 如果你想检查某一个函数循环的时间
System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); //这里是你想检测的时间 stopwatch.Stop(); System.TimeSpan timeSpan = stopwatch.Elapsed; double hours = timeSpan.TotalHours; double minutes = timeSpan.TotalMinutes; double seconds = timeSpan.TotalSeconds; double milliseconds = timeSpan.TotalMilliseconds; Debug.Log("总小时:" + hours); Debug.Log("总分钟:" + minutes); Debug.Log("总秒:" + seconds); Debug.Log("总毫秒:" + milliseconds);
标签:
原文地址:http://www.cnblogs.com/plateFace/p/4671884.html