I need to test the response time from a web url to see if it’s getting a slow response. I have this from a tutorial website (can’t remember which) but it doesn’t do exactly what I want:
On Error Resume Next
Set XMLHttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", "http://website.url.com" , 0
xmlhttp.send ""
If Err.Number < 0 OR Err.Number > 0 Then
Dim objShell
Set objShell = WScript.CreateObject ("WScript.shell")
MsgBox "TimeOut"
Set objShell = Nothing
WScript.Quit
Else
MsgBox "OK"
End If
Set xmlhttp = Nothing
This script only tests if the site timesout or not. I would need more detailed information such as even if it doesn’t time out, how long was the response time, etc.
OK, I found the solution:
All credits go to this website and it’s author: http://www.windowsitpro.com/article/vbscript/how-can-i-use-a-vbscript-script-to-ping-a-machine-