The issue is what your client's definitions are.
A browser starts rendering as soon it receives data. Is that your
starting point?
If your definition is that "as soon as all data is received" and until
browser has fully displayed things, this is a bit more difficult. First,
there's no event for this. The closest approximation is
"DOMContentLoaded", which is used by JQuery's documentready. The
difference between "all data received" and "DOM parsing done" is the cpu
cycles it takes to parse the main DOM tree. Since your clients already
are asking for fractions of seconds in the common case, this is significant.
Secondly, window.onload is your stoptime event, but this doesn't fire
until /everything/ is loaded. This means any networking problems with
content have to time out, but for the end user, everything displays
correctly. In fact, a user can click on to the next page before this
even fires.
So, reliably, you can't really do this and your best approximation is
the event firing times for window.onload minus DOMContentLoaded, or
JQuery's $(document).ready [1].
You can embed the row id for your statistics as a JavaScript variable in
your template.
And finally, you'd send the calculation back using Ajax requests,
something you'll find plenty of howto's for on the web.
[1]
<
http://stackoverflow.com/questions/799981/document-ready-equivalent-without-jquery>
--
Melvyn Sopacua