RE: Calculating Page Load Time
"Gale, David" <[email protected]>
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Chris wrote: > Although those complications all present themselves, this actually is > a very good idea. You can always do a simple calculation to determine > the download time of an item, or a set of items, but what matters > usability wise is how long it takes from the user's request to the > requested page being ready to use - that includes parse and > initialization time, which is just the information you'd end up with. > You could subtract the server's timestamp from the timestamp on the > onload event, and send that back via AJAX to aggregate usability > statistics on your site. You just might capture some surprising > statistics relating to server lag or scripts that slow a machine to a > crawl. > > You even could go so far as to only include the timestamp and script > in every 1000 requests or so to get a good sample without burdening > every single request. The problem here is that you require the server clock to be in sync with the client's clock, which is more than likely not the case. Better would be to have a generic onclick() function attached to all anchor tags that calculates a time-stamp & appends it to the requested URL (bonus points: make it only apply to internal URLs); each page could then have a generic function that gets called when everything's loaded up, and if the timestamp parameter was passed, calculate the difference and feed it back to the server. That'd give you the full request time, from the point the user clicked a link and started waiting all the way through to the end of the load process. -David Unsubscribe [email protected] List info http://www.quirksmode.org/dom/list.html Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wdf-dom/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/