DelegateProfilerTests CheckIndividualDurationOfDoingSomethingSlowAThousandTimes Method Delta Engine Documentation

Namespace: DeltaEngine.Profiling.Tests
Assembly: DeltaEngine.Profiling.Tests (in DeltaEngine.Profiling.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void CheckIndividualDurationOfDoingSomethingSlowAThousandTimes()
Examples

[Test, Category("Slow")]
public void CheckIndividualDurationOfDoingSomethingSlowAThousandTimes()
{
    var profiler = new DelegateProfiler(() => Thread.Sleep(1));
    int duration = profiler.AverageDurationInNanoseconds;
    Assert.IsTrue(duration > 950);
    Console.WriteLine(duration + " nanoseconds each");
}
See Also