using System; using System.Diagnostics; internal class ProfilerTest//Profiler改为ProfilerTest,要不然与UnityEngine.Profiler冲突 { private Stopwatch watch = new Stopwatch(); public void Start() { watch.Reset(); watch.Start(); } public void Stop() { watch.Stop(); } public long ElapsedTicks { get { return watch.ElapsedTicks; } } }