简体   繁体   English

HTML5(衡量页面加载时间)

[英]HTML5 (measure the page load time)

I checked the W3C web page but I dont fully understand the difference in the following 2: 我检查了W3C网页,但我不完全了解以下2种差异:

  1. performance.timing.navigationStart performance.timing.navigationStart

" This attribute must return the time immediately after the user agent finishes prompting to unload the previous document. If there is no previous document, this attribute must return the time the current document is created. " “此属性必须在用户代理完成提示卸载先前文档后立即返回时间。如果没有先前文档,则此属性必须返回创建当前文档的时间。”

2 window.performance.timing 2 window.performance.timing

" The timing attribute represents the timing information related to the browsing contexts since the last non-redirect navigation. This attribute is defined by the PerformanceTiming interface. " “ Timing属性表示自上次非重定向导航以来与浏览上下文有关的时序信息。此属性由PerformanceTiming接口定义。”

I dont fully understand these mean. 我不完全理解这些意思。 Can someone explain this in detail? 有人可以详细解释吗?

performance.timing and window.performance.timing are the same thing, an object containing a record of when events such as navigationStart occured performance.timing和window.performance.timing是同一件事,一个对象,其中包含诸如navigationStart之类的事件何时发生的记录

   performance.timing === window.performance.timing

other timing events are listed here 其他计时事件在这里列出

EDIT: 编辑:

window is the global namespace, it contains a reference to all global variables including performance.timing window是全局名称空间,它包含对所有全局变量(包括performance.timing)的引用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM