W3C home > Mailing lists > Public > public-web-perf@w3.org > July 2012

Re: [NavigationTiming] waiting for loadEventEnd to get set

From: Patrick Meenan <pmeenan@webpagetest.org>
Date: Fri, 6 Jul 2012 07:24:35 -0400
Message-ID: <7087849066719177546@unknownmsgid>
To: Larry Martell <larry.martell@gmail.com>
Cc: "public-web-perf@w3.org" <public-web-perf@w3.org>
Try a 0-length setTimeout. LoadEventEnd can't be set until the
execution of all onload handlers completes (including the one you are
using to measure).

You could also just use loadEventStart which is probably what you want
from what you describe anyway.

Sent from my slab of glass with no keyboard so it will be a miracle if
you receive what I meant to type.

On Jul 6, 2012, at 3:49 AM, Larry Martell <larry.martell@gmail.com> wrote:

> 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 11:25:04 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:04:33 UTC