Beispiel #1
0
        public void CanDiscoverTypesInAssembly()
        {
            var engine = new BenchmarkEngine(new BenchmarkOptions()
            {
                Repetitions = 1
            }, new Assembly[] { GetType().Assembly });
            var results = engine.Execute();

            Assert.AreEqual(3, results.Count(), "This test library contains three valid benchmark classes.");
        }
Beispiel #2
0
        static void Main()
        {
            Console.WriteLine("Performing benchmarks...");
            //Process.Start(BenchmarkEngine.ExecuteAndRenderWithDefaults(null, new BenchmarkOptions { Repetitions = 10 }));

            var engine = new BenchmarkEngine(new BenchmarkOptions {
                Repetitions = 10
            }, new Assembly[] { typeof(Program).Assembly });
            var renderer = new ExcelOutputRenderer();

            string outputPath = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString() + ".xlsx");

            renderer.RenderTo(outputPath, engine.Execute());

            Process.Start(outputPath);
        }