Index: third_party/WebKit/Source/core/timing/PerformanceBase.cpp |
diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp |
index ac075b2a4934013fe6f5e10af681b23e3ec6b359..ad653c600a557a110a2ed88b301a6fd6c0e36149 100644 |
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp |
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp |
@@ -415,11 +415,17 @@ void PerformanceBase::deliverObservationsTimerFired(Timer<PerformanceBase>*) |
} |
} |
+// static |
+double PerformanceBase::clampTimeResolution(double timeSeconds) |
+{ |
+ const double resolutionSeconds = 0.000005; |
+ return floor(timeSeconds / resolutionSeconds) * resolutionSeconds; |
+} |
+ |
double PerformanceBase::now() const |
{ |
double nowSeconds = monotonicallyIncreasingTime() - m_timeOrigin; |
- const double resolutionSeconds = 0.000005; |
- return 1000.0 * floor(nowSeconds / resolutionSeconds) * resolutionSeconds; |
+ return 1000.0 * clampTimeResolution(nowSeconds); |
} |
DEFINE_TRACE(PerformanceBase) |