aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/performance.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2014-12-15 23:55:00 +0530
committerManish Goregaokar <manishsmail@gmail.com>2014-12-16 08:28:11 +0530
commiteec68faa41dbe783cfba3fd92e6094629c126427 (patch)
tree0ae5e37fe14e330aa08bedc91bc5a92e713dfcfe /components/script/dom/performance.rs
parent1bc2c8a6397382b4db8fb09582434f4798d43868 (diff)
downloadservo-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.rs5
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
}
}