RE: Calculating Page Load Time

"Ryan Hicks" <[email protected]>
Newsgroups gmane.comp.web.dom.wdf
Message-ID <[email protected]>
 The onLoad event doesn't fire until all of the content (including external
content) has been downloaded and initialized for that window or frame.

 I see a couple problems with this method of calculating page load time,
though.  First, the onLoad event fires after initialization, not just
download, which will extend the calculated time arbitrarily depending on the
client's processing speed.

 Second, the initial timestamp recorded in the header will only execute when
that fragment of HTML is fully downloaded.  That is, if you have a large
HTML document, there will be unrecorded time between the initial browser
request and the beginning of your calculation.  This delay can be mitigated
by flushing the header to the browser before the main page content is sent,
but it cannot be removed entirely.

 Without knowing what you're trying to measure, there are a ton of sites out
there that you can use as a proxy to tell you the download speed of a page
(and external content for the good ones) from anywhere in the world.  While
not as accurate as studying your actual users, it's a reasonable place to
start.

 Perhaps the best way is to simply look at the total download size of all of
your content and do some math.. ;)

-ryan

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
James Childers
Sent: Thursday, January 26, 2006 11:16 AM
To: [email protected]
Subject: Re: [wdf-dom] Calculating Page Load Time

That would tell you how long it took to transfer the HTML file which  
is running the script. It wouldn't tell you how long it took to  
transfer the other GET requests (stylesheets, JavaScript includes,  
images, etc.). Nor would it tell you how long it took to actually  
render the page. You would need to attach an onload event to all  
script, image, object, and iframe tags.

The more I think about it the more I think such a thing would be very  
difficult to implement using client-side JavaScript. Why do you want  
to know the page load time?

James Childers
Sr. Java Developer
[email protected]
469-335-1483



On Jan 26, 2006, at 11:36 AM, Maninder, Singh wrote:

> Greetings Everyone,
>
> I would like to know what's the best way to calculate the page load  
> time (as well when dom has loaded)?
>
> I have different javascript & css files included in my page and  
> then some js & html code in the page.
>
> If I calculate the timestamp in the head and then onload call  
> another function to calculate timestamp again and diff these two -  
> would that be a correct way of doing this?
>
> Any help would be much appreciated.
>
> Regards,
> Mandy.
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> Unsubscribe
> [email protected]
>
> List info
> http://www.quirksmode.org/dom/list.html
>
>
> YAHOO! GROUPS LINKS
>
>  Visit your group "wdf-dom" on the web.
>
>  To unsubscribe from this group, send an email to:
>  [email protected]
>
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>



[Non-text portions of this message have been removed]



Unsubscribe
[email protected]

List info
http://www.quirksmode.org/dom/list.html 
Yahoo! Groups Links



 




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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.