add a benchmark mode

This commit is contained in:
Matthias Mailänder
2015-11-28 13:49:11 +01:00
parent 7335c4a8ce
commit d4e842e643
3 changed files with 25 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))