/// <summary> /// Renders the timing details of the Nested Logical Context item and appends it to the specified <see cref="StringBuilder" />. /// </summary> /// <param name="builder">The <see cref="StringBuilder"/> to append the rendered data to.</param> /// <param name="logEvent">Logging event.</param> protected override void Append(StringBuilder builder, LogEventInfo logEvent) { TimeSpan?scopeDuration = CurrentScope ? ScopeContext.PeekInnerNestedDuration() : ScopeContext.PeekOuterNestedDuration(); if (scopeDuration.HasValue) { if (scopeDuration.Value < TimeSpan.Zero) { scopeDuration = TimeSpan.Zero; } if (StartTime) { var formatProvider = GetFormatProvider(logEvent, null); var scopeBegin = Time.TimeSource.Current.Time.Subtract(scopeDuration.Value); builder.Append(scopeBegin.ToString(Format, formatProvider)); } else { #if !NET35 var formatProvider = GetFormatProvider(logEvent, null); builder.Append(scopeDuration.Value.ToString(Format, formatProvider)); #else builder.Append(scopeDuration.Value.ToString()); #endif } } }