DelegateProfiler AverageDurationInPicoseconds 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 AverageDurationInPicoseconds { get; }

Property Value

Type: Int32
Remarks

Tests: DeltaEngine.Profiling.Tests.DelegateProfilerTests
Examples

2 unit tests call DeltaEngine.Profiling.DelegateProfiler.AverageDurationInPicoseconds
[Test, Category("Slow")]
public void CheckIndividualDurationOfDoingSomethingFastAMillionTimes()
{
    var profiler = new DelegateProfiler(DoSomeMaths, 1000000);
    int duration = profiler.AverageDurationInPicoseconds;
    Assert.IsTrue(duration > 5);
    Console.WriteLine(duration + " picoseconds each");
}
[Test, Timeout(5000)]
public void DurationOfSingularFastActionIsNoticed()
{
    var profiler = new DelegateProfiler(DoSomeMaths, 1);
    int duration = profiler.AverageDurationInPicoseconds;
    Assert.IsTrue(duration > 0);
}
See Also