这篇翻译不完整。请帮忙从英语翻译这篇文章。
The Performance interface represents timing related performance information for the given page.
An object of this type can be obtained by calling the Window.performance read-only attribute.
Note: Although an object of this interface is available to Worker contexts, only a subset of the properties and methods are available. Those not available are labelled as such on this page.
Properties
The Performance interface doesn't inherit any property.
Performance.timing只读 Not available to workers- Is a
PerformanceTimingobject containing latency-related performance information. Performance.navigation只读 Not available to workers- Is a
PerformanceNavigationobject representing the type of navigation that occurs in the given browsing context, like the amount of redirections needed to fetch the resource.
Methods
The Performance interface doesn't inherit any method.
Performance.now()- Returns a
DOMHighResTimeStamprepresenting the amount of milliseconds elapsed since a reference instant. Performance.toJSON()Not available to workers- Is a jsonizer returning a json object representing the
Performanceobject.
Specifications
| Specification | Status | Comment |
|---|---|---|
| High Resolution Time Performance |
Recommendation | Added the now() method. |
| Navigation Timing Performance |
Recommendation | Initial definition. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
Basic support (timing attribute) |
6.0 | 7.0 (7.0) | 9.0 | 15.0 | 8 |
navigation attribute |
未实现 | 未实现 | 9.0 | 未实现 | 8 |
now() on regular context |
20.0 webkit 24.0 |
15.0 (15.0) | 10.0 | (Yes) | 8 |
now() in Web workers. |
(Yes) | 34.0 (34.0) | ? | (Yes) | ? |
toJSON() |
未实现 | 25.0 (25.0) | 9.0 | 未实现 | ? |
| Feature | Android | Firefox Mobile (Gecko) | Firefox OS | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | 未实现 | 7.0 (7.0) | 1.0 (7.0) | 9.0 | 15.0 | 未实现 |
navigation attribute |
未实现 | 未实现 | 未实现 | 9.0 | 未实现 | 未实现 |
now() on regular context |
20.0 webkit 24.0 |
15.0 (15.0) | 1.0 (15.0) | 10.0 | 未实现 | 未实现 |
now() in Web workers. |
? | 34.0 (34.0) | ? | ? | ? | ? |
toJSON() |
未实现 | 25.0 (25.0) | 1.2 (25.0) | 9.0 | 未实现 | 未实现 |
See also
- Related interfaces:
PerformanceTiming,PerformanceNavigation.

