private static long MeasureStartupMilliseconds(Benchmark benchmark) { var sw = new Stopwatch(); sw.Start(); var op = benchmark.GetOperation(); op(); sw.Stop(); return(sw.ElapsedMilliseconds); }
private static void SerialRunForPeformanceAnalysis(Benchmark benchmark) { var op = benchmark.GetOperation(); var worker = new Thread(() => { while (true) { op(); } }); worker.Start(); Thread.Sleep(60000); // Run for 1 minute worker.Abort(); }
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(); }
private static void Debug(Benchmark benchmark) { var op = benchmark.GetOperation(); op(); }
private static long MeasureStartupMilliseconds(Benchmark benchmark) { var sw = new Stopwatch(); sw.Start(); var op = benchmark.GetOperation(); op(); sw.Stop(); return sw.ElapsedMilliseconds; }