Activity.Duration Property

Definition

Gets the duration of the operation.

C#
public TimeSpan Duration { get; }

Property Value

The delta between StartTimeUtc and the end time if the Activity has ended (Stop() or SetEndTime(DateTime) was called), or Zero if the Activity has not ended and SetEndTime(DateTime) was not called.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)