Exemple #1
0
        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;
 }
Exemple #3
0
        public void StartRegion(string name)
        {
            if (!this.Enabled)
            {
                return;
            }

            var newRegion = new PerformanceRegion(this.PerformanceStopwatch.ElapsedMilliseconds, name, this.CurrentPerformanceRegion);

            this.CurrentPerformanceRegion = newRegion;
        }
Exemple #4
0
        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;
        }