PerformanceTiming - Web APIs 编辑

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

The 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 property.

Properties

The 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.

This deprecated API should no longer be used, but will probably still work. PerformanceTiming.navigationStart Read only
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.
This deprecated API should no longer be used, but will probably still work. PerformanceTiming.unloadEventStart Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.unloadEventEnd Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.redirectStart Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.redirectEnd Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.fetchStart Read only
When the browser is ready to fetch the document using an HTTP request. This moment is before the check to any application cache.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.domainLookupStart Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.domainLookupEnd Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.connectStart Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.connectEnd Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.secureConnectionStart Read only
When the secure connection handshake starts. If no such connection is requested, it returns 0.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.requestStart Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.responseStart Read only
When the browser received the first byte of the response, from the server from a cache, or from a local resource.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.responseEnd Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.domLoading Read only
When the parser started its work, that is when its Document.readyState changes to 'loading' and the corresponding readystatechange event is thrown.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.domInteractive Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.domContentLoadedEventStart Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.domContentLoadedEventEnd Read only
Right after all the scripts that need to be executed as soon as possible, in order or not, have been executed.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.domComplete Read only
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.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.loadEventStart Read only
When the load event was sent for the current document. If this event has not yet been sent, it returns 0.
This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.loadEventEnd Read only
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.

Methods

The PerformanceTiming interface doesn't inherit any methods.

This deprecated API should no longer be used, but will probably still work.  PerformanceTiming.toJSON() This API has not been standardized.
Returns a JSON object representing this PerformanceTiming object.

Specifications

SpecificationStatusComment
Navigation Timing
The definition of 'PerformanceTiming' in that specification.
RecommendationInitial definition.

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:157 次

字数:32301

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文