DelegateProfiler AverageDurationInNanoseconds Property Delta Engine Documentation

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

public int AverageDurationInNanoseconds { get; }

Property Value

Type: Int32
Remarks

Tests: DeltaEngine.Profiling.Tests.DelegateProfilerTests
Examples

1 unit tests call DeltaEngine.Profiling.DelegateProfiler.AverageDurationInNanoseconds
[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