예제 #1
0
		public void CheckTotalDurationOfDoingSomethingFastAMillionTimes()
		{
			var profiler = new DelegateProfiler(DoSomeMaths, 1000000);
			int duration = profiler.TotalDurationInMilliseconds;
			Assert.IsTrue(duration > 5);
			Console.WriteLine(duration + " milliseconds for 1,000,000 iterations");
		}
예제 #2
0
		public void CheckIndividualDurationOfDoingSomethingFastAMillionTimes()
		{
			var profiler = new DelegateProfiler(DoSomeMaths, 1000000);
			int duration = profiler.AverageDurationInPicoseconds;
			Assert.IsTrue(duration > 5);
			Console.WriteLine(duration + " picoseconds each");
		}
예제 #3
0
		public void CheckTotalDurationOfDoingSomethingSlowAThousandTimes()
		{
			var profiler = new DelegateProfiler(() => Thread.Sleep(1));
			int totalDuration = profiler.TotalDurationInMilliseconds;
			Assert.IsTrue(totalDuration > 950);
			Console.WriteLine(totalDuration + " milliseconds for 1,000 iterations");
		}
예제 #4
0
		public void CheckIndividualDurationOfDoingSomethingSlowAThousandTimes()
		{
			var profiler = new DelegateProfiler(() => Thread.Sleep(1));
			int duration = profiler.AverageDurationInNanoseconds;
			Assert.IsTrue(duration > 950);
			Console.WriteLine(duration + " nanoseconds each");
		}
예제 #5
0
        public void DurationOfSingularFastActionIsNoticed()
        {
            var profiler = new DelegateProfiler(DoSomeMaths, 1);
            int duration = profiler.AverageDurationInPicoseconds;

            Assert.IsTrue(duration > 0);
        }
예제 #6
0
        public void CheckIndividualDurationOfDoingSomethingFastAMillionTimes()
        {
            var profiler = new DelegateProfiler(DoSomeMaths, 1000000);
            int duration = profiler.AverageDurationInPicoseconds;

            Assert.IsTrue(duration > 5);
            Console.WriteLine(duration + " picoseconds each");
        }
예제 #7
0
        public void CheckTotalDurationOfDoingSomethingFastAMillionTimes()
        {
            var profiler = new DelegateProfiler(DoSomeMaths, 1000000);
            int duration = profiler.TotalDurationInMilliseconds;

            Assert.IsTrue(duration > 5);
            Console.WriteLine(duration + " milliseconds for 1,000,000 iterations");
        }
예제 #8
0
        public void CheckIndividualDurationOfDoingSomethingSlowAThousandTimes()
        {
            var profiler = new DelegateProfiler(() => Thread.Sleep(1));
            int duration = profiler.AverageDurationInNanoseconds;

            Assert.IsTrue(duration > 950);
            Console.WriteLine(duration + " nanoseconds each");
        }
예제 #9
0
        public void CheckTotalDurationOfDoingSomethingSlowAThousandTimes()
        {
            var profiler      = new DelegateProfiler(() => Thread.Sleep(1));
            int totalDuration = profiler.TotalDurationInMilliseconds;

            Assert.IsTrue(totalDuration > 950);
            Console.WriteLine(totalDuration + " milliseconds for 1,000 iterations");
        }
예제 #10
0
		public void DurationOfSingularFastActionIsNoticed()
		{
			var profiler = new DelegateProfiler(DoSomeMaths, 1);
			int duration = profiler.AverageDurationInPicoseconds;
			Assert.IsTrue(duration > 0);
		}