示例#1
0
		private static void RunBatch(OrmLiteConfigRun configRun)
		{
			Console.Write(";");
			var useCases = GetUseCases();

			useCases.ForEach(uc => Console.Write("{0};", uc.GetType().Name));
			Console.WriteLine();
			BatchIterations.ForEach(iterations => {
				Console.Write("{0};", iterations);
				useCases.ForEach(uc => {

					configRun.Init(uc);

					// warmup
					uc.Run();
					GC.Collect();
					Console.Write("{0};", Measure(uc.Run, iterations));
				});
				Console.WriteLine();
			});
		}
示例#2
0
		private static void RunInteractive(OrmLiteConfigRun configRun, string[] args)
		{
			long iterations = DefaultIterations;

			if (args.Length != 0)
				iterations = long.Parse(args[0]);

			Console.WriteLine("Running {0} iterations for each use case.", iterations);

			var useCases = GetUseCases();
			useCases.ForEach(uc => {

				configRun.Init(uc);

				// warmup
				uc.Run();
				GC.Collect();
               	
				var avgMs = Measure(uc.Run, iterations);
				Console.WriteLine("{0}: Avg: {1}ms", uc.GetType().Name, avgMs);
			});
		}