Namespace: DeltaEngine.Profiling
Assembly: DeltaEngine.Profiling (in DeltaEngine.Profiling.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Profiling.Tests.DelegateProfilerTests
2 unit tests call DeltaEngine.Profiling.DelegateProfiler.TotalDurationInMilliseconds
Assembly: DeltaEngine.Profiling (in DeltaEngine.Profiling.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: Int32Remarks
Examples
[Test, Category("Slow")] 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"); }
[Test, Category("Slow")] 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"); }
See Also