summaryrefslogtreecommitdiffstats
path: root/dom/performance/PerformanceTiming.cpp
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-03-17 13:26:47 +0100
committerGitHub <noreply@github.com>2018-03-17 13:26:47 +0100
commita24511ca8e19afe4d19008ba903e1edab0af3223 (patch)
tree2bcc3a87b20b9dedacd38b7b6d447abb15184f3e /dom/performance/PerformanceTiming.cpp
parent11bdaa144d8a38ecd897dde278cb1db9b8313961 (diff)
parentbdaacef069f954129ecc84365351af3a84de4463 (diff)
downloadUXP-a24511ca8e19afe4d19008ba903e1edab0af3223.tar
UXP-a24511ca8e19afe4d19008ba903e1edab0af3223.tar.gz
UXP-a24511ca8e19afe4d19008ba903e1edab0af3223.tar.lz
UXP-a24511ca8e19afe4d19008ba903e1edab0af3223.tar.xz
UXP-a24511ca8e19afe4d19008ba903e1edab0af3223.zip
Merge pull request #68 from janekptacijarabaci/js_dom_performancetiming_1
Round down to the nearest 2ms (instead of 1ms) by using timerclamping function
Diffstat (limited to 'dom/performance/PerformanceTiming.cpp')
-rwxr-xr-xdom/performance/PerformanceTiming.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/dom/performance/PerformanceTiming.cpp b/dom/performance/PerformanceTiming.cpp
index 97bbcb0ca..5f771f0aa 100755
--- a/dom/performance/PerformanceTiming.cpp
+++ b/dom/performance/PerformanceTiming.cpp
@@ -307,12 +307,8 @@ PerformanceTiming::SecureConnectionStartHighRes()
if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized()) {
return mZeroTime;
}
-
- // Round down to the nearest 1ms
- const double maxResolutionMs = 1;
- return mSecureConnectionStart.IsNull()
- ? mZeroTime
- : floor(TimeStampToDOMHighRes(mSecureConnectionStart) / maxResolutionMs) * maxResolutionMs;
+ return mSecureConnectionStart.IsNull() ? mZeroTime
+ : TimerClamping::ReduceMsTimeValue(TimeStampToDOMHighRes(mSecureConnectionStart));
}
DOMTimeMilliSec