Pings a host and returns the roundtrip-time.
Ping ( "address/hostname" [, timeout] )
| address/hostname | Can be i.e. "www.autoitscript.com" or "87.106.244.38". |
| timeout | [optional] Is the time to wait for an answer in milliseconds (default is 4000). |
| Success: | Returns the roundtrip-time in milliseconds ( greater than 0 ). |
| Failure: | Returns 0 if host is not pingable or other network errors occurred and sets @error. (See Remarks) |
Local $var = Ping("www.AutoItScript.com", 250)
If $var Then; also possible: If @error = 0 Then ...
MsgBox(0, "Status", "Online, roundtrip was:" & $var)
Else
MsgBox(0, "Status", "An error occured with number: " & @error)
EndIf