473,473 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help - page, rendering time

Hi,

I want display page rendering time.

Is correct this code? :

<html>
<head>
<SCRIPT>
var timestampa =new Date;
var timeInit = timestampa.getTime();
</SCRIPT>

<script language="JavaScript">
function displayRenderingTimestamp() {
var timestampb=new Date;

alert (timestampb.getTime() - timeInit );
}
</script>
</head>
<body topmargin="0" rightmargin="0" leftmargin="0" bottommargin="0"
marginwidth="0" marginheight="0" onLoad="displayRenderingTimestamp()">

Or must be implemented init function to set start timestamp?

Thanks for any suggestion,
Fabio
Jul 23 '05 #1
1 1586
fabius wrote:
Hi,

I want display page rendering time.

Is correct this code? :

<html>
<head>
<SCRIPT>
var timestampa =new Date;
var timeInit = timestampa.getTime();
</SCRIPT>

<script language="JavaScript">
function displayRenderingTimestamp() {
var timestampb=new Date;

alert (timestampb.getTime() - timeInit );
}
</script>
</head>
<body topmargin="0" rightmargin="0" leftmargin="0" bottommargin="0"
marginwidth="0" marginheight="0" onLoad="displayRenderingTimestamp()">

Or must be implemented init function to set start timestamp?


Your code should do what you want, but I'd use "new Date()"

<SCRIPT type="text/javascript">
timeInit = new Date().getTime();
function displayRenderingTimestamp() {
alert (new Date().getTime() - timeInit );
}
onload=displayRenderingTimestamp; //in milliseconds
</script>

And you really don't need to use the Date object's "getTime()" method,

dateObj1-dateObj2 will yield the difference in milliseconds between two
valid date objects.(Automatic type conversion)
Mick

Mick
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Quick Function | last post by:
Hi, I developed a site and used css. I put almost all style information in the css and used a lot of "id=my_css_class" in the html. They is little style specification in the html. I found that on...
8
by: slim | last post by:
hi again all, i am still working on the website as mentioned in earlier threads and have hit another snag... http://awash.demon.co.uk/index.php http://awash.demon.co.uk/vd.css the php is...
20
by: Joe exCSSive | last post by:
Hi, folks: I'm back...and now I'm really stuck !! I have a graphic ( http://www.sundialontario.com/images/makeitatable.jpg ) that I would like to convert to CSS and I'm not sure how to do...
3
by: usenet | last post by:
Hi All, I have some initialization to be done at page load time, which changes the text of some anchors so that they are consistent with the query string (these anchors are used as criteria...
5
by: Rick Spiewak | last post by:
I need to generate a "buy" button as part of an ASP.NET page - this consists of a small HTML form with hidden fields, conforming to the requirements of a merchant credit card processor. PayPal is...
2
by: Jeronimo Bertran | last post by:
I have an aspx page that shows a complex image with several objects that are sensitive to mouseover events. The information about the objects in the image is obtained from a database and complex...
6
by: Xavier | last post by:
hello, what is the best way to display display the time needed for rendering the information. I must get the difference of time from the start of rendering till the finish rendering the page -...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.