12 references to FormatDuration
Aspire.Dashboard (1)
Otlp\Model\OtlpSpanEvent.cs (1)
20
string IPropertyGridItem.Name => DurationFormatter.
FormatDuration
(Time - span.StartTime);
Aspire.Dashboard.Tests (11)
DurationFormatterTests.cs (11)
32
Assert.Equal("1μs", DurationFormatter.
FormatDuration
(TimeSpan.FromTicks(1 * TimeSpan.TicksPerMicrosecond)));
39
Assert.Equal("10d 14h", DurationFormatter.
FormatDuration
(TimeSpan.FromTicks(input)));
46
Assert.Equal("2d", DurationFormatter.
FormatDuration
(TimeSpan.FromTicks(input)));
53
Assert.Equal(2.36m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.
FormatDuration
(TimeSpan.FromTicks(input)));
60
Assert.Equal(2.36m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.
FormatDuration
(TimeSpan.FromTicks(input)));
67
Assert.Equal("2m 31s", DurationFormatter.
FormatDuration
(TimeSpan.FromTicks(input)));
74
Assert.Equal("2h 31m", DurationFormatter.
FormatDuration
(TimeSpan.FromTicks(input)));
81
Assert.Equal(0.92m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.
FormatDuration
(TimeSpan.FromTicks(input)));
88
Assert.Equal(0.92m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.
FormatDuration
(TimeSpan.FromTicks(input)));
95
Assert.Equal(0.1m.ToString("0.##μs", CultureInfo.CurrentCulture), DurationFormatter.
FormatDuration
(TimeSpan.FromTicks((long)input)));
102
Assert.Equal("0μs", DurationFormatter.
FormatDuration
(TimeSpan.FromTicks(input)));