Program.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Linq;
  3. using System.Threading.Tasks;
  4. using BenchmarkDotNet.Running;
  5. using Content.IntegrationTests;
  6. using Content.Server.Maps;
  7. #if DEBUG
  8. using BenchmarkDotNet.Configs;
  9. #else
  10. using Robust.Benchmarks.Configs;
  11. #endif
  12. using Robust.Shared.Prototypes;
  13. namespace Content.Benchmarks
  14. {
  15. internal static class Program
  16. {
  17. public static void Main(string[] args)
  18. {
  19. #if DEBUG
  20. Console.ForegroundColor = ConsoleColor.Red;
  21. Console.WriteLine("\nWARNING: YOU ARE RUNNING A DEBUG BUILD, USE A RELEASE BUILD FOR AN ACCURATE BENCHMARK");
  22. Console.WriteLine("THE DEBUG BUILD IS ONLY GOOD FOR FIXING A CRASHING BENCHMARK\n");
  23. BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, new DebugInProcessConfig());
  24. #else
  25. var config = Environment.GetEnvironmentVariable("ROBUST_BENCHMARKS_ENABLE_SQL") != null ? DefaultSQLConfig.Instance : null;
  26. BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config);
  27. #endif
  28. }
  29. }
  30. }