diff --git a/isometric-park-fna/FNAGame.cs b/isometric-park-fna/FNAGame.cs --- a/isometric-park-fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -62,6 +62,8 @@ TimeSpan gridDrawTime = TimeSpan.Zero; TimeSpan treeDrawTime = TimeSpan.Zero; TimeSpan updateTime = TimeSpan.Zero; + TimeSpan worldUpdateTime = TimeSpan.Zero; + TimeSpan simulationUpdateTime = TimeSpan.Zero; Queue past_fps = new Queue(100); Queue past_draw = new Queue(100); @@ -479,6 +481,7 @@ protected override void Update(GameTime gameTime) { Stopwatch stopWatch = new Stopwatch(); + Stopwatch stopWatch2 = new Stopwatch(); stopWatch.Start(); #if DEBUG @@ -504,8 +507,16 @@ #endregion misc_keys #endregion input + stopWatch2.Start(); World.Update(gameTime.ElapsedGameTime.TotalSeconds); + stopWatch2.Stop(); + this.worldUpdateTime = stopWatch2.Elapsed; + + stopWatch2 = new Stopwatch(); + stopWatch2.Start(); this.simulation.update(gameTime.ElapsedGameTime); + stopWatch2.Stop(); + this.simulationUpdateTime = stopWatch2.Elapsed; if (this.showBudget) { @@ -976,6 +987,8 @@ gridDrawTime = this.gridDrawTime, tileDrawTime = this.tileDrawTime, updateTime = this.updateTime, + worldUpdateTime = this.worldUpdateTime, + simulationUpdateTime = this.simulationUpdateTime, treeCount = this.simulation.map.tree_count, mouseGrid = this.mouseGrid, hasTree = has_tree, diff --git a/isometric-park-fna/UI/DebugWindow.cs b/isometric-park-fna/UI/DebugWindow.cs --- a/isometric-park-fna/UI/DebugWindow.cs +++ b/isometric-park-fna/UI/DebugWindow.cs @@ -26,6 +26,9 @@ public Boolean hasTree; public int tilesDrawn; public TimeSpan updateTime; + public TimeSpan worldUpdateTime; + public TimeSpan simulationUpdateTime; + } public class DebugWindow @@ -232,6 +235,9 @@ debugInfo.gridDrawTime.TotalMilliseconds.ToString(), debugInfo.tileDrawTime.TotalMilliseconds.ToString())); ImGui.Text(string.Format("Update Time: {0:F3}", debugInfo.updateTime.TotalMilliseconds.ToString())); + ImGui.Text(string.Format("\tWorld: {0:F3}; Simulation: {1:F3}", + debugInfo.worldUpdateTime.TotalMilliseconds.ToString(), + debugInfo.simulationUpdateTime.TotalMilliseconds.ToString())); ImGui.Text(string.Format("Tiles Drawn: {0:F}", debugInfo.tilesDrawn));