private static void AddGo() { if (CpuStatistic.Instance == null) { GameObject gameObject = new GameObject("CpuStatistic"); CpuStatistic.Instance = gameObject.AddComponent <CpuStatistic>(); } }
private void Awake() { CpuStatistic.Instance = this; for (int i = 0; i < 9; i++) { CpuStatistic.arr[i] = new CpuStatisticInfo(); CpuStatistic.arr[i].statisticName = (CpuStatisticType)i + ":"; } }
public static void SampleBegin(CpuStatisticType type) { CpuStatistic.AddGo(); CpuStatistic.arr[(int)type]._sampleBeginTime = DateTime.Now.Ticks; }