How to check the HTTP web server respond speed

Eric Chatonet eric.chatonet at sosmartsoftware.com
Tue Jan 3 05:27:13 EST 2006


Hi Alex,

The following works here:

function haveIPconnect
   local theHostName,tstartTime
   -----
   put fld "domain" into theHostName
   if colon is not in theHostName then
     put colon & "80|test" after theHostName
   end if
   put the long seconds into tstartTime
   -----
   open socket theHostName
   if theHostName is among the lines of openSockets() then
     return (the long seconds - tstartTime)
   end if
   return "error"
end haveIPconnect

Returns 0.000022 for my own website.

Best Regards from Paris,
Eric Chatonet

Le 3 janv. 06 à 11:03, alex wu a écrit :

> Hello,
>
> I want to compare the speed of webservers.  I try to
> use the following function.  However the respond time
> (Server_Speed) of almost all servers I test is zero.
> I don't believe that the response speed of all
> webservers are so fast - zero.  There must be some
> problem with the way I calculate it.  Please help.
>
> function haveIPconnect
>   put fld "domain" into theHostName
>   if colon is not in theHostName then
>     put colon & "80|test" after theHostName
>   end if
>
>   ## Record the start time
>   put the long seconds into startTime
>
>   open socket theHostName
>   if theHostName is among the lines of the openSockets
> then
>
>     ## Calculate the response time
>     put the long seconds - startTime into Server_Speed
>
>     close socket theHostName
>     return true
>   else
>     beep
>     answer warning "The site may be down"
>     return false
>   end if
> end haveIPconnect
>
>
> Thanks and best regards
>
> Alex

------------------------------------------------------------------------ 
----------------------
http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/





More information about the use-livecode mailing list