diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2014-12-15 23:55:00 +0530 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2014-12-16 08:28:11 +0530 |
commit | eec68faa41dbe783cfba3fd92e6094629c126427 (patch) | |
tree | 0ae5e37fe14e330aa08bedc91bc5a92e713dfcfe /components/script/dom/performance.rs | |
parent | 1bc2c8a6397382b4db8fb09582434f4798d43868 (diff) | |
download | servo-eec68faa41dbe783cfba3fd92e6094629c126427.tar.gz servo-eec68faa41dbe783cfba3fd92e6094629c126427.zip |
Fix window.performance.now()
Diffstat (limited to 'components/script/dom/performance.rs')
-rw-r--r-- | components/script/dom/performance.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/dom/performance.rs b/components/script/dom/performance.rs index 60f5abfec95..3fc094eeb65 100644 --- a/components/script/dom/performance.rs +++ b/components/script/dom/performance.rs @@ -47,9 +47,10 @@ impl<'a> PerformanceMethods for JSRef<'a, Performance> { Temporary::new(self.timing.clone()) } + // https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now fn Now(self) -> DOMHighResTimeStamp { - let navStart = self.timing.root().NavigationStartPrecise() as f64; - (time::precise_time_s() - navStart) as DOMHighResTimeStamp + let navStart = self.timing.root().NavigationStartPrecise(); + (time::precise_time_ns() as f64 - navStart) * 1000000u as DOMHighResTimeStamp } } |