using UnityEngine;
using System.Collections;
using System.Diagnostics;
public class NewBehaviourScript : MonoBehaviour {
void Start () {
float t = Time.time;
TestMethod();
UnityEngine.Debug.Log(string.Format("total: {0} ms",Time.time - t));
Stopwatch sw = new Stopwatch();
sw.Start();
TestMethod();
sw.Stop();
UnityEngine.Debug.Log(string.Format("total: {0} ms",sw.ElapsedMilliseconds));
Profiler.BeginSample("TestMethod");
TestMethod();
Profiler.EndSample();
}
Unity3D之获取某个方法执行的时间
最新推荐文章于 2023-01-14 15:06:21 发布