diff options
-rw-r--r-- | dom/performance/PerformanceTiming.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dom/performance/PerformanceTiming.cpp b/dom/performance/PerformanceTiming.cpp index 32ddea823a..4070b6a0f9 100644 --- a/dom/performance/PerformanceTiming.cpp +++ b/dom/performance/PerformanceTiming.cpp @@ -307,10 +307,12 @@ PerformanceTiming::SecureConnectionStartHighRes() if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized()) { return mZeroTime; } - // Rounding to 1ms + + // Round down to the nearest 1ms + const double maxResolutionMs = 1; return mSecureConnectionStart.IsNull() ? mZeroTime - : floor(TimeStampToDOMHighRes(mSecureConnectionStart) / 1) * 1; + : floor(TimeStampToDOMHighRes(mSecureConnectionStart) / maxResolutionMs) * maxResolutionMs; } DOMTimeMilliSec |