W3C home > Mailing lists > Public > public-web-perf@w3.org > February 2014

Re: Notification for new navigation timing entries

From: Ilya Grigorik <igrigorik@google.com>
Date: Fri, 28 Feb 2014 10:49:12 -0800
Message-ID: <CADXXVKr2ivtONUstRA9r_nEWxQv1_MFVfx6wOOT51KQphX_kRg@mail.gmail.com>
To: Joshua Peek <josh@joshpeek.com>
Cc: public-web-perf <public-web-perf@w3.org>
On Mon, Feb 17, 2014 at 9:33 AM, Joshua Peek <josh@joshpeek.com> wrote:

> Theres no notification when
> new performance entries have been recorded. This requires invasive
> code to recheck the performance entries buffer.
>

Josh, why wouldn't you just use measure / clearMarks? I don't think you
need to traverse the full buffer.

function markIt(name) {
  performance.mark(name); // or use measure with optional start/end params
  // grab the timing data, do what you need to do with it
  performance.clearMarks(name);
}

// your code
markIt("some-event");
// more code
markIt("other-event");

Point being, you know when the event is available.. it's when you call
mark. For NavTiming this happens to be after onloadEnd.

ig
Received on Friday, 28 February 2014 18:50:20 UTC

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