mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Fix window.performance.now()
This commit is contained in:
parent
1bc2c8a639
commit
eec68faa41
2 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue