예제 #1
0
        private static long MeasureStartupMilliseconds(Benchmark benchmark)
        {
            var sw = new Stopwatch();

            sw.Start();
            var op = benchmark.GetOperation();

            op();
            sw.Stop();
            return(sw.ElapsedMilliseconds);
        }
예제 #2
0
        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();
        }
예제 #3
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();
        }
예제 #4
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();
        }
예제 #5
0
        private static void Debug(Benchmark benchmark)
        {
            var op = benchmark.GetOperation();

            op();
        }
예제 #6
0
 private static void Debug(Benchmark benchmark)
 {
     var op = benchmark.GetOperation();
     op();
 }
예제 #7
0
 private static long MeasureStartupMilliseconds(Benchmark benchmark)
 {
     var sw = new Stopwatch();
     sw.Start();
     var op = benchmark.GetOperation();
     op();
     sw.Stop();
     return sw.ElapsedMilliseconds;
 }