- From: Larry Martell <larry.martell@gmail.com>
- Date: Fri, 6 Jul 2012 06:41:01 -0600
- To: "Deng, Pan" <pan.deng@intel.com>
- Cc: "public-web-perf@w3.org" <public-web-perf@w3.org>
On Fri, Jul 6, 2012 at 3:39 AM, Deng, Pan <pan.deng@intel.com> wrote: > I also met this problem, in chromium. > I think reason is window.onload event is fired just after "loadEventStart" and before "loadEventEnd" > As a workaround and minimal your "function()"'s effect to 'loadEventEnd' time, > I think you can use setTimeout with window.onload > > Hope that helpful, thanks :) Thanks. A 0-length setTimeout worked. > > Pan > > -----Original Message----- > From: Larry Martell [mailto:larry.martell@gmail.com] > Sent: Friday, July 06, 2012 12:03 PM > To: public-web-perf@w3.org > Subject: [NavigationTiming] waiting for loadEventEnd to get set > > I'm trying to use the Navigation Timing package to measure how long a page takes to be rendered. So that would be loadEventEnd-responseEnd, however I am finding that loadEventEnd is always 0 for me, even though I am accessing it from within a window.onload function, e.g: > > window.onload = function() { > var t = performance.timing; > var render_time = parseInt(t['loadEventEnd']) - parseInt(t['responseEnd']); } > > If I check in the console after the page is loaded it does have a value. What event do I have to wait for before loadEventEnd gets set? > > > Thanks! > -larry > >
Received on Friday, 6 July 2012 12:42:14 UTC