Solved

Measuring speed of web pages

Posted on 2004-04-19
6
357 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
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.
Viewers will learn how to use the Hootsuite Dashboard.

707 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

16 Experts available now in Live!

Get 1:1 Help Now