예제 #1
0
        public void EndRegion()
        {
            if (!this.Enabled)
            {
                return;
            }

            this.CurrentPerformanceRegion.End(this.PerformanceStopwatch.ElapsedMilliseconds);
            this.CurrentPerformanceRegion = this.CurrentPerformanceRegion.Parent;
        }
예제 #2
0
 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;
 }
예제 #3
0
        public void StartRegion(string name)
        {
            if (!this.Enabled)
            {
                return;
            }

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

            this.CurrentPerformanceRegion = newRegion;
        }
예제 #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;
        }