PerformanceTiming

This interface is deprecated in the Navigation Timing Level 2 specification . Please use the PerformanceNavigationTiming interface instead.

PerformanceTiming interface is a legacy interface kept for backwards compatibility and contains properties that offer performance timing information for various events which occur during the loading and use of the current page. You get a PerformanceTiming object describing your page using the window.performance.timing 特性。

特性

PerformanceTiming interface doesn't inherit any properties.

These properties each describe the time at which a particular point in the page loading process was reached. Some correspond to DOM events; others describe the time at which internal browser operations of interest took place.

Each time is provided as an unsigned long long representing the moment, in milliseconds since the UNIX epoch

These properties are listed in the order in which they occur during the navigation process.

PerformanceTiming.navigationStart 只读
When the prompt for unload terminates on the previous document in the same browsing context. If there is no previous document, this value will be the same as PerformanceTiming.fetchStart .
PerformanceTiming.unloadEventStart 只读
When the unload event has been thrown, indicating the time at which the previous document in the window began to unload. If there is no previous document, or if the previous document or one of the needed redirects is not of the same origin, the value returned is 0 .
PerformanceTiming.unloadEventEnd 只读
When the unload event handler finishes. If there is no previous document, or if the previous document, or one of the needed redirects, is not of the same origin, the value returned is 0 .
PerformanceTiming.redirectStart 只读
When the first HTTP redirect starts. If there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0 .
PerformanceTiming.redirectEnd 只读
When the last HTTP redirect is completed, that is when the last byte of the HTTP response has been received. If there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0 .
PerformanceTiming.fetchStart 只读
When the browser is ready to fetch the document using an HTTP request. This moment is before the check to any application cache.
PerformanceTiming.domainLookupStart 只读
When the domain lookup starts. If a persistent connection is used, or the information is stored in a cache or a local resource, the value will be the same as PerformanceTiming.fetchStart .
PerformanceTiming.domainLookupEnd 只读
When the domain lookup is finished. If a persistent connection is used, or the information is stored in a cache or a local resource, the value will be the same as PerformanceTiming.fetchStart .
PerformanceTiming.connectStart 只读
When the request to open a connection is sent to the network. If the transport layer reports an error and the connection establishment is started again, the last connection establishment start time is given. If a persistent connection is used, the value will be the same as PerformanceTiming.fetchStart .
PerformanceTiming.connectEnd 只读
When the connection is opened network. If the transport layer reports an error and the connection establishment is started again, the last connection establishment end time is given. If a persistent connection is used, the value will be the same as PerformanceTiming.fetchStart . A connection is considered as opened when all secure connection handshake, or SOCKS authentication, is terminated.
PerformanceTiming.secureConnectionStart 只读
When the secure connection handshake starts. If no such connection is requested, it returns 0 .
PerformanceTiming.requestStart 只读
When the browser sent the request to obtain the actual document, from the server or from a cache. If the transport layer fails after the start of the request and the connection is reopened, this property will be set to the time corresponding to the new request.
PerformanceTiming.responseStart 只读
When the browser received the first byte of the response, from the server from a cache, or from a local resource.
PerformanceTiming.responseEnd 只读
When the browser received the last byte of the response, or when the connection is closed if this happened first, from the server, the cache, or from a local resource.
PerformanceTiming.domLoading 只读
When the parser started its work, that is when its Document.readyState changes to 'loading' and the corresponding readystatechange event is thrown.
PerformanceTiming.domInteractive 只读
When the parser finished its work on the main document, that is when its Document.readyState changes to 'interactive' and the corresponding readystatechange event is thrown.
PerformanceTiming.domContentLoadedEventStart 只读
Right before the parser sent the DOMContentLoaded event, that is right after all the scripts that need to be executed right after parsing have been executed.
PerformanceTiming.domContentLoadedEventEnd 只读
Right after all the scripts that need to be executed as soon as possible, in order or not, have been executed.
PerformanceTiming.domComplete 只读
When the parser finished its work on the main document, that is when its Document.readyState changes to 'complete' and the corresponding readystatechange event is thrown.
PerformanceTiming.loadEventStart 只读
When the load event was sent for the current document. If this event has not yet been sent, it returns 0.
PerformanceTiming.loadEventEnd 只读
When the load event handler terminated, that is when the load event is completed. If this event has not yet been sent, or is not yet completed, it returns 0.

方法

PerformanceTiming interface doesn't inherit any methods.

PerformanceTiming.toJSON()
返回 JSON object representing this PerformanceTiming 对象。

规范

规范 状态 Comment
导航计时
The definition of 'PerformanceTiming' in that specification.
Recommendation 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
PerformanceTiming
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 8 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 8 Samsung Internet Android 1.0
connectEnd
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
connectStart
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
domainLookupEnd
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
domainLookupStart
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
domComplete
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
domContentLoadedEventEnd
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 8 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 8 Samsung Internet Android 1.0
domContentLoadedEventStart
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
domInteractive
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
domLoading
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
fetchStart
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
loadEventEnd
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
loadEventStart
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
navigationStart
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari Yes WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS Yes Samsung Internet Android 1.0
redirectEnd
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
redirectStart
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
requestStart
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
responseEnd
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
responseStart
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
secureConnectionStart
弃用
Chrome 6 Edge 18 Firefox 56 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 56 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
toJSON
弃用
Chrome 44 Edge 12 Firefox 25 IE 9 Opera 32 Safari Yes WebView Android 44 Chrome Android 44 Firefox Android 25 Opera Android 32 Safari iOS Yes Samsung Internet Android 4.0
unloadEventEnd
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0
unloadEventStart
弃用
Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 11 WebView Android Yes Chrome Android 18 Firefox Android 7 Opera Android 14 Safari iOS 11 Samsung Internet Android 1.0

图例

完整支持
完整支持
弃用。不要用于新网站。
弃用。不要用于新网站。

另请参阅