Solved

Measuring speed of web pages

Posted on 2004-04-19
6
383 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
A list of useful business intelligence software.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

776 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