Solved

Measuring speed of web pages

Posted on 2004-04-19
6
373 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 12

Assisted Solution

by:venkateshwarr
venkateshwarr earned 62 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 63 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

864 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now