Get Time taken to ping - Vb.net

time to ping

Snippet Code


  
Rate this page :
  [ 0 votes]

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")

Tags


Ask Questions

Ask Question