private void FPSTimer() { this.frames++; this.time += Time.unscaledDeltaTime; if (this.time < 1f) { return; } Performance.current.frameRate = this.frames; Performance.current.frameTime = this.time / (float)this.frames * 1000f; Performance.frameRateHistory[checked ((IntPtr)(Performance.cycles % (long)((int)Performance.frameRateHistory.Length)))] = Performance.current.frameRate; Performance.frameTimeHistory[checked ((IntPtr)(Performance.cycles % (long)((int)Performance.frameTimeHistory.Length)))] = Performance.current.frameTime; Performance.current.frameRateAverage = this.AverageFrameRate(); Performance.current.frameTimeAverage = this.AverageFrameTime(); Performance.current.memoryUsageSystem = (long)SystemInfoEx.systemMemoryUsed; Performance.current.memoryAllocations = GC.GetTotalMemory(false) / (long)1048576; Performance.current.memoryCollections = (long)GC.CollectionCount(0); Performance.current.loadBalancerTasks = (long)LoadBalancer.Count(); Performance.current.invokeHandlerTasks = (long)InvokeHandler.Count(); this.frames = 0; this.time = 0f; Performance.cycles += (long)1; Performance.report = Performance.current; }
private void FPSTimer() { ++this.frames; this.time += Time.get_unscaledDeltaTime(); if ((double)this.time < 1.0) { return; } Performance.current.frameRate = this.frames; Performance.current.frameTime = (float)((double)this.time / (double)this.frames * 1000.0); Performance.frameRateHistory[Performance.cycles % (long)Performance.frameRateHistory.Length] = Performance.current.frameRate; Performance.frameTimeHistory[Performance.cycles % (long)Performance.frameTimeHistory.Length] = Performance.current.frameTime; Performance.current.frameRateAverage = this.AverageFrameRate(); Performance.current.frameTimeAverage = this.AverageFrameTime(); Performance.current.memoryUsageSystem = (long)SystemInfoEx.systemMemoryUsed; Performance.current.memoryAllocations = GC.GetTotalMemory(false) / 1048576L; Performance.current.memoryCollections = (long)GC.CollectionCount(0); Performance.current.loadBalancerTasks = (long)LoadBalancer.Count(); Performance.current.invokeHandlerTasks = (long)InvokeHandler.Count(); this.frames = 0; this.time = 0.0f; ++Performance.cycles; Performance.report = Performance.current; }