From e5b1a9937ff12413cbfb8ed80c3983873ba97745 Mon Sep 17 00:00:00 2001 From: lv dada <417611525@qq.com> Date: Sun, 8 Nov 2015 13:19:14 +0800 Subject: [PATCH] change annotate of initDomTreeTime and domReadyTime , besides add new attr interactingTime --- timing.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/timing.js b/timing.js index ebd38ca..8f5ff3e 100644 --- a/timing.js +++ b/timing.js @@ -67,7 +67,7 @@ // Total time from start to load api.loadTime = timing.loadEventEnd - timing.fetchStart; - // Time spent constructing the DOM tree + // Time completion of the DOM loading api.domReadyTime = timing.domComplete - timing.domInteractive; // Time consumed preparing the new page api.readyStart = timing.fetchStart - timing.navigationStart; @@ -83,10 +83,12 @@ api.connectTime = timing.connectEnd - timing.connectStart; // Time spent during the request api.requestTime = timing.responseEnd - timing.requestStart; - // Request to completion of the DOM loading + // Time spent constructing the DOM tree api.initDomTreeTime = timing.domInteractive - timing.responseEnd; // Load event time api.loadEventTime = timing.loadEventEnd - timing.loadEventStart; + // Dom can interacting time + api.interactingTime = timing.domContentLoadedEventEnd - timing.navigationStart } return api;