Esempio n. 1
0
        private static void SerialRunForPeformanceAnalysis(Benchmark benchmark)
        {
            var op = benchmark.GetOperation();
            bool keepGoing = true;
            var worker = new Thread(() =>
            {
                while (keepGoing)
                {
                    op();
                }
            });

            worker.Start();
            Thread.Sleep(60000); // Run for 1 minute
            keepGoing = false;
            worker.Join();
        }
Esempio n. 2
0
 public Suite(string name, int standardRunOperations, Benchmark[] includedBenchmarks)
 {
     _name = name; _standardRunOperations = standardRunOperations; _includedBenchmarks = includedBenchmarks;
 }
Esempio n. 3
0
 private static void Debug(Benchmark benchmark)
 {
     var op = benchmark.GetOperation();
     op();
 }
Esempio n. 4
0
 private static long MeasureStartupMilliseconds(Benchmark benchmark)
 {
     var sw = new Stopwatch();
     sw.Start();
     var op = benchmark.GetOperation();
     op();
     sw.Stop();
     return sw.ElapsedMilliseconds;
 }