Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Measuring speed of web pages

Posted on 2004-04-19
6
Medium Priority
?
422 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

660 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