public static long Time(IBlock4 block)
 {
     Db4objects.Db4o.Foundation.StopWatch stopWatch = new Db4objects.Db4o.Foundation.StopWatch
                                                          ();
     stopWatch.Start();
     block.Run();
     stopWatch.Stop();
     return(stopWatch.Elapsed());
 }
Example #2
0
 public static long Time(IBlock4 block)
 {
     var stopWatch = new StopWatch
         ();
     stopWatch.Start();
     block.Run();
     stopWatch.Stop();
     return stopWatch.Elapsed();
 }
Example #3
0
		public static long Time(IBlock4 block)
		{
			Db4objects.Db4o.Foundation.StopWatch stopWatch = new Db4objects.Db4o.Foundation.StopWatch
				();
			stopWatch.Start();
			block.Run();
			stopWatch.Stop();
			return stopWatch.Elapsed();
		}
Example #4
0
        public static long Time(IBlock4 block)
        {
            var stopWatch = new StopWatch
                                ();

            stopWatch.Start();
            block.Run();
            stopWatch.Stop();
            return(stopWatch.Elapsed());
        }
Example #5
0
		/// <exception cref="IOException"></exception>
		private void BenchmarkCommand(string command, int itemCount, string dbFileName, TextWriter
			 @out)
		{
			HashSet commands = CommandSet(command);
			Db4objects.Db4o.IO.IoAdapter io = IoAdapter(dbFileName);
			LogReplayer replayer = new LogReplayer(CrudApplication.LogFileName(itemCount), io
				, commands);
			List4 commandList = replayer.ReadCommandList();
			StopWatch watch = new StopWatch();
			watch.Start();
			replayer.PlayCommandList(commandList);
			watch.Stop();
			io.Close();
			long timeElapsed = watch.Elapsed();
			long operationCount = ((long)replayer.OperationCounts()[command]);
			PrintStatisticsForCommand(@out, command, timeElapsed, operationCount);
		}