Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Measuring speed of web pages

Posted on 2004-04-19
6
Medium Priority
?
435 Views
Last Modified: 2013-11-15
I have various scripts doing the same task written in different scripting languages (php, ASP, ASP.NET and Oracle JSP). I need to measure the speed that the (Windows) server takes to send out the pages to work out which one works best. Does anyone have any ideas about how I might accomplish this?
0
Comment
Question by:daveluck
6 Comments
 
LVL 10

Expert Comment

by:Bustarooms
ID: 10863349
is this what you're looking for?
http://www.websiteoptimization.com/services/analyze/
0
 

Author Comment

by:daveluck
ID: 10863770
I think the speeds from that are based on the speed that the page takes to download based on the size. As the four pieces of code produce exactly the same html output to the browser they'll come out with the same times. I want to know how long the page takes to parse.
0
 
LVL 2

Expert Comment

by:sc0rp10n
ID: 10864482
A simple way that you can do it is via javascript (or any other web languages that you use). Basically I would suggest start the timer at the top of the page, stop at the bottom of the page (or even when it should really finish processing any server-side code, and then display the difference.

This is just a general idea and im sure there are a few better ways to do it using a scripting technology.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Assisted Solution

by:venkateshwarr
venkateshwarr earned 186 total points
ID: 10865093
The following script gets the time(milliseconds) it takes for the response to reach the client...
Here only the response time of the page is taken and not the response time of other links like images,scripts that are associated with the page.

But here the to and fro time are also included along with server response time.... So you will get the only a propotional value and not the exact value.

<SCRIPT LANGUAGE="JavaScript">
<!--

var objXML = new ActiveXObject("Microsoft.XMLHTTP");
var html;
var starttime,endtime,diff;

starttime=new Date();
objXML.open('GET','http://www.samachar.com',false);
objXML.send();
html = objXML.responseText
endtime=new Date();
diff=endtime-starttime;
alert(diff);

//alert(objXML.responseText);

//-->
</SCRIPT>
0
 
LVL 2

Accepted Solution

by:
Splat earned 189 total points
ID: 10890440
As an example in ASP (similar to sc0rp10n's suggestion), I record the time before my section of code starts, execute my code, and then check the time again and calculate the time taken to execute that part of the code.

eg:

<%
Dim timerStart
timerStart = Timer

' code to execute goes here

Response.Write "Time taken : " & Timer - timerStart & " seconds"
%>

That should return a the number of seconds, up to 6 decimal places.

If you can write similar code for your other languages, then you can compare the time it takes each one.

0
 

Author Comment

by:daveluck
ID: 10898536
I will try your suggestion Splat. I think it might work.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
Web hosting control panels were first developed to make it faster and easier for most users to set up and operate websites. The graphical user interface (GUI) allows users to perform tasks by pointing and clicking rather than typing highly specific…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question