简体   繁体   中英

HTML5 (measure the page load time)

I checked the W3C web page but I dont fully understand the difference in the following 2:

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

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

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

other timing events are listed here

EDIT:

window is the global namespace, it contains a reference to all global variables including performance.timing

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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