PerformanceTiming

PerformanceTiming 接口包含了当前页面中与时间相关的信息。

可以通过只读属性Performance.timing 获得实现该接口的一个对象。

属性

PerformanceTiming 接口不包含任何继承属性。

PerformanceTiming.navigationStart 只读
是一个无符号long long 型的毫秒数,表征了从同一个浏览器上下文的上一个文档卸载(unload)结束时的UNIX时间戳。如果没有上一个文档,这个值会和PerformanceTiming.fetchStart相同。
PerformanceTiming.unloadEventStart 只读
是一个无符号long long 型的毫秒数,表征了unload事件抛出时的UNIX时间戳。如果没有上一个文档,or if the previous document, or one of the needed redirects, is not of the same origin, 这个值会返回0.
PerformanceTiming.unloadEventEnd 只读
是一个无符号long long 型的毫秒数,表征了unload事件处理完成时的UNIX时间戳。如果没有上一个文档,or if the previous document, or one of the needed redirects, is not of the same origin, 这个值会返回0.
PerformanceTiming.redirectStart 只读
是一个无符号long long 型的毫秒数,表征了第一个HTTP重定向开始时的UNIX时间戳。如果没有重定向,或者重定向中的一个不同源,这个值会返回0.
PerformanceTiming.redirectEnd 只读
是一个无符号long long 型的毫秒数,表征了最后一个HTTP重定向完成时(也就是说是HTTP响应的最后一个比特直接被收到的时间)的UNIX时间戳。如果没有重定向,或者重定向中的一个不同源,这个值会返回0.
PerformanceTiming.fetchStart 只读
是一个无符号long long 型的毫秒数,表征了浏览器准备好使用HTTP请求来获取(fetch)文档的UNIX时间戳。这个时间点会在检查任何应用缓存之前。
PerformanceTiming.domainLookupStart 只读
是一个无符号long long 型的毫秒数,表征了域名查询开始的UNIX时间戳。如果使用了持续连接(persistent connection),或者这个信息存储到了缓存或者本地资源上,这个值将和 PerformanceTiming.fetchStart一致。
PerformanceTiming.domainLookupEnd 只读
是一个无符号long long 型的毫秒数,表征了域名查询结束的UNIX时间戳。如果使用了持续连接(persistent connection),或者这个信息存储到了缓存或者本地资源上,这个值将和 PerformanceTiming.fetchStart一致。
PerformanceTiming.connectStart 只读
是一个无符号long long 型的毫秒数,返回HTTP请求开始向服务器发送时的Unix毫秒时间戳。如果使用持久连接(persistent connection),则返回值等同于fetchStart属性的值。
PerformanceTiming.connectEnd 只读
是一个无符号long long 型的毫秒数,返回浏览器与服务器之间的连接建立时的Unix毫秒时间戳。如果建立的是持久连接,则返回值等同于fetchStart属性的值。连接建立指的是所有握手和认证过程全部结束。
PerformanceTiming.secureConnectionStart 只读
是一个无符号long long 型的毫秒数,返回浏览器与服务器开始安全链接的握手时的Unix毫秒时间戳。如果当前网页不要求安全连接,则返回0。
PerformanceTiming.requestStart 只读
是一个无符号long long 型的毫秒数,返回浏览器向服务器发出HTTP请求时(或开始读取本地缓存时)的Unix毫秒时间戳。
PerformanceTiming.responseStart 只读
是一个无符号long long 型的毫秒数,返回浏览器从服务器收到(或从本地缓存读取)第一个字节时的Unix毫秒时间戳。如果传输层在开始请求之后失败并且连接被重开,该属性将会被数制成新的请求的相对应的发起时间。
PerformanceTiming.responseEnd 只读
是一个无符号long long 型的毫秒数,返回浏览器从服务器收到(或从本地缓存读取,或从本地资源读取)最后一个字节时(如果在此之前HTTP连接已经关闭,则返回关闭时)的Unix毫秒时间戳。
PerformanceTiming.domLoading 只读
是一个无符号long long 型的毫秒数,返回当前网页DOM结构开始解析时(即Document.readyState属性变为“loading”、相应的 readystatechange事件触发时)的Unix毫秒时间戳。
PerformanceTiming.domInteractive 只读
是一个无符号long long 型的毫秒数,返回当前网页DOM结构结束解析、开始加载内嵌资源时(即Document.readyState属性变为“interactive”、相应的readystatechange事件触发时)的Unix毫秒时间戳。
PerformanceTiming.domContentLoadedEventStart 只读
是一个无符号long long 型的毫秒数,返回当解析器发送DOMContentLoaded 事件,即所有需要被执行的脚本已经被解析时的Unix毫秒时间戳。
PerformanceTiming.domContentLoadedEventEnd 只读
是一个无符号long long 型的毫秒数,返回当所有需要立即执行的脚本已经被执行(不论执行顺序)时的Unix毫秒时间戳。
PerformanceTiming.domComplete 只读
是一个无符号long long 型的毫秒数,返回当前文档解析完成,即Document.readyState 变为 'complete'且相对应的readystatechange 被触发时的Unix毫秒时间戳。
PerformanceTiming.loadEventStart 只读
是一个无符号long long 型的毫秒数,返回该文档下,load事件被发送时的Unix毫秒时间戳。如果这个事件还未被发送,它的值将会是0。
PerformanceTiming.loadEventEnd 只读
是一个无符号long long 型的毫秒数,返回当load事件结束,即加载事件完成时的Unix毫秒时间戳。如果这个事件还未被发送,或者尚未完成,它的值将会是0.

方法

Performance 接口不包含任何方法。

PerformanceTiming.toJSON()
是一个JSON格式化工具,返回一个 JSON 对象,代表具体的 PerformanceTiming 对象。

规范

规范名称 规范状态 说明
Navigation Timing
PerformanceTiming
Recommendation Initial definition.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic support
Deprecated
Chrome Full support 6Edge Full support 12Firefox Full support 7IE Full support 9Opera Full support 15Safari Full support 8WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS Full support 9.2Samsung Internet Android ?
connectEnd
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
connectStart
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
domComplete
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
domContentLoadedEventEnd
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari Full support 8WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS Full support 9.2Samsung Internet Android ?
domContentLoadedEventStart
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
domInteractive
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
domLoading
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
domainLookupEnd
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
domainLookupStart
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
fetchStart
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS Full support YesSamsung Internet Android ?
loadEventEnd
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
loadEventStart
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
navigationStart
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS Full support YesSamsung Internet Android ?
redirectEnd
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
redirectStart
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
requestStart
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
responseEnd
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
responseStart
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
secureConnectionStart
Deprecated
Chrome Full support 6Edge Full support 18Firefox Full support 56IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support 56Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
toJSON
Deprecated
Chrome Full support 44Edge Full support YesFirefox Full support 25IE Full support 9Opera Full support 32Safari Full support YesWebView Android Full support 44Chrome Android Full support 44Edge Mobile Full support YesFirefox Android Full support 25Opera Android Full support 32Safari iOS Full support YesSamsung Internet Android ?
unloadEventEnd
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
unloadEventStart
Deprecated
Chrome Full support 6Edge Full support YesFirefox Full support 7IE Full support 9Opera Full support 15Safari No support NoWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 7Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

相关链接

文档标签和贡献者

标签: 
此页面的贡献者: fscholz, micblo, wolf-wolf, CeHOU, Scott-Coder, coolguy, teoli, ziyunfei
最后编辑者: fscholz,