public void Begin(string name) { if (currNode.Name != name) { ProfilerNode n = currNode.GetChildByName(name); if (n == null) { n = new ProfilerNode(currNode.Depth + 1); this.nodes.Add(n); currNode.Childern.Add(n); n.Parent = currNode; } if (n.Name == null || n.Name.Length == 0) { n.Name = name; } currNode = n; currNode.Begin(); } else { currNode.End(); currNode.Begin(); } }
public override void Update(float elapsed) { if (rootNode.OpenProfiles > 0) { rootNode.End(); } rootNode.Begin(); this.Begin("update"); this.frameCounter += 1; this.dataReady = this.frameCounter == this.frameFrequency; if (this.dataReady) { this.frameCounter = 0; int count = this.nodes.Count; for (int i = 0; i < count; i++) { this.nodes[i].Compute(); } for (int i = 0; i < count; i++) { this.nodes[i].Reset(); } if (this.ReportOnNextReady) { this.ReportOnNextReady = false; this.OutputReport(rootNode); } } }