[Javascript] how to find the time taken for loading a page

BEKIM BACAJ trojani2000 at hotmail.com
Mon May 26 14:58:43 CDT 2003


There is no standard procedure of this kind that I know of; -But you could 
build something like this:
(a plain example)
<script>
var d1,t1
d1=new Date()
t1=d1.getTime()

function downloadTime(){

   var d, t,s = 1000 ;

   d = new Date();
   t = d.getTime();

var dif=(t-t1)/s;

if (dif>59){
	dif=(dif/60);
alert(dif + ' minutes')}
	else{
	alert(dif+' seconds')
	}
}
</script>
<HTML>
<HEAD>

</HEAD>
<BODY onload="downloadTime()">...
(...the rest of the document goes here...)

Regards!


>From: "Jagannayakam" <jagann at wisorindia.soft.net>
>Reply-To: "[JavaScript List]" <javascript at LaTech.edu>
>To: <javascript at LaTech.edu>
>Subject: [Javascript] how to find the time taken for loading a page
>Date: Fri, 16 May 2003 11:27:56 +0530
>
>Hi ,
>
>How to find the time taken for a page to get loaded in the browser.
>
>Regards,
>Jagan.
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail



More information about the Javascript mailing list