Returns the time taken to ping an IP or a hostname.
Public Shared Function GetPingMs(ByRef hostNameOrAddress As String)
Dim ping As New System.Net.NetworkInformation.Ping
Return ping.Send(hostNameOrAddress).RoundtripTime
End Function
' call this function using (IP Address).
GetPingMs("127.0.0.1")
' call this function using (HostName).
GetPingMs("www.hscripts.com")