Ejemplo n.º 1
0
        private static void RunCustomBenchmark()
        {
            var networkBenchmark = INetworkBenchmark.CreateNetworkBenchmark(BenchmarkCoordinator.Config.Library);

            try
            {
                BenchmarkCoordinator.PrepareBenchmark(networkBenchmark);
                BenchmarkCoordinator.RunBenchmark(networkBenchmark);
            }
            catch (Exception e)
            {
                Console.WriteLine($"Error when running Library {BenchmarkCoordinator.Config.Library}" +
                                  $"\n{e.Message}\n{e.StackTrace}");
            }
            finally
            {
                try
                {
                    BenchmarkCoordinator.CleanupBenchmark(networkBenchmark);
                }
                catch (Exception e)
                {
                    Console.WriteLine($"Error when cleaning up Library {BenchmarkCoordinator.Config.Library}" +
                                      $"\n{e.Message}\n{e.StackTrace}");
                }

                Console.Write(BenchmarkCoordinator.PrintStatistics());
            }
        }