Merge pull request #10133 from Mailaender/benchmark

Added a benchmark mode
This commit is contained in:
abcdefg30
2015-12-29 15:20:28 +01:00
4 changed files with 37 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -39,6 +40,19 @@ namespace OpenRA.Mods.Common.LoadScreens
Ui.ResetAll();
Game.Settings.Save();
if (Launch.Benchmark)
{
Log.AddChannel("cpu", "cpu.csv");
Log.Write("cpu", "tick;time [ms]");
Log.AddChannel("render", "render.csv");
Log.Write("render", "frame;time [ms]");
Console.WriteLine("Saving benchmark data into {0}".F(Path.Combine(Platform.SupportDir, "Logs")));
Game.BenchmarkMode = true;
}
// Join a server directly
var connect = Launch.GetConnectAddress();
if (!string.IsNullOrEmpty(connect))