public void EndRegion() { if (!this.Enabled) { return; } this.CurrentPerformanceRegion.End(this.PerformanceStopwatch.ElapsedMilliseconds); this.CurrentPerformanceRegion = this.CurrentPerformanceRegion.Parent; }
public PerformanceRegion(float currentTotalElapsedSeconds, string name, PerformanceRegion parent = null) { if (parent != null) { this.Parent = parent; this.Parent.Children.Add(this); } this.Name = name; this.StartTotalElapsedMilliseconds = currentTotalElapsedSeconds; }
public void StartRegion(string name) { if (!this.Enabled) { return; } var newRegion = new PerformanceRegion(this.PerformanceStopwatch.ElapsedMilliseconds, name, this.CurrentPerformanceRegion); this.CurrentPerformanceRegion = newRegion; }
public void Start(string name = "Game Loop") { if (!this.Enabled) { return; } this.PerformanceStopwatch.Restart(); // start the root region. this.RootPerformanceRegion = new PerformanceRegion(this.PerformanceStopwatch.ElapsedMilliseconds, name); this.CurrentPerformanceRegion = this.RootPerformanceRegion; }