diff --git a/src/MiniProfiler.Shared/CustomTiming.cs b/src/MiniProfiler.Shared/CustomTiming.cs
index d305ad83..eb1fa126 100644
--- a/src/MiniProfiler.Shared/CustomTiming.cs
+++ b/src/MiniProfiler.Shared/CustomTiming.cs
@@ -37,7 +37,7 @@ public CustomTiming(MiniProfiler profiler, string commandString, decimal? minSav
CommandString = commandString;
Id = Guid.NewGuid();
- StartMilliseconds = profiler.GetRoundedMilliseconds(profiler.ElapsedTicks);
+ StartMilliseconds = profiler.GetMilliseconds(profiler.ElapsedTicks);
if (includeStackTrace && !profiler.Options.ExcludeStackTraceSnippetFromCustomTimings)
{
diff --git a/src/MiniProfiler.Shared/MiniProfiler.cs b/src/MiniProfiler.Shared/MiniProfiler.cs
index f5468a8b..f7f2f7bc 100644
--- a/src/MiniProfiler.Shared/MiniProfiler.cs
+++ b/src/MiniProfiler.Shared/MiniProfiler.cs
@@ -282,7 +282,7 @@ private bool InnerStop()
}
Stopwatch.Stop();
- DurationMilliseconds = GetRoundedMilliseconds(ElapsedTicks);
+ DurationMilliseconds = GetMilliseconds(ElapsedTicks);
foreach (var timing in GetTimingHierarchy())
{
@@ -366,13 +366,12 @@ internal Timing StepImpl(string? name, decimal? minSaveMs = null, bool? includeC
new Timing(this, Head, name, minSaveMs, includeChildrenWithMinSave);
///
- /// Returns milliseconds based on Stopwatch's Frequency, rounded to two decimal places.
+ /// Returns milliseconds based on Stopwatch's Frequency.
///
- /// The tick count to round.
- internal decimal GetRoundedMilliseconds(long ticks)
+ /// The tick count.
+ internal decimal GetMilliseconds(long ticks)
{
- long times100 = ticks * 100000 / Stopwatch.Frequency;
- return times100 / 100m;
+ return ticks * 1000M / Stopwatch.Frequency;
}
///
@@ -380,6 +379,6 @@ internal decimal GetRoundedMilliseconds(long ticks)
///
/// The start tick count.
internal decimal GetDurationMilliseconds(long startTicks) =>
- GetRoundedMilliseconds(ElapsedTicks - startTicks);
+ GetMilliseconds(ElapsedTicks - startTicks);
}
}
diff --git a/src/MiniProfiler.Shared/Timing.cs b/src/MiniProfiler.Shared/Timing.cs
index 87404bb6..7a03a364 100644
--- a/src/MiniProfiler.Shared/Timing.cs
+++ b/src/MiniProfiler.Shared/Timing.cs
@@ -73,7 +73,7 @@ public Timing(MiniProfiler profiler, Timing? parent, string? name, decimal? minS
_startTicks = profiler.ElapsedTicks;
_minSaveMs = minSaveMs;
_includeChildrenWithMinSave = includeChildrenWithMinSave == true;
- StartMilliseconds = profiler.GetRoundedMilliseconds(_startTicks);
+ StartMilliseconds = profiler.GetMilliseconds(_startTicks);
if (profiler.Options.EnableDebugMode)
{