({{, (RefLink[PingTime, paclet:ref/PingTime])[host] 
gives the round-trip ping time for the specified network host.}, {, (RefLink[PingTime, paclet:ref/PingTime])[host,n]
gives a list of times for n successive pings.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[PingTime, paclet:ref/PingTime])[host] uses standard ICMP datagrams. The host may be specified as "hostname" or (RefLink[IPAddress, paclet:ref/IPAddress])["addr"].

Times are reported in milliseconds.

(RefLink[PingTime, paclet:ref/PingTime]) takes the following options:

Option settings t are interpreted as t seconds. Settings involving (RefLink[Quantity, paclet:ref/Quantity]) can also be used.

The setting (RefLink[UpdateInterval, paclet:ref/UpdateInterval])->t specifies that (RefLink[PingTime, paclet:ref/PingTime]) will wait for time t after a reply packet is received before sending out the next ping.

With the default set of (RefLink[TimeConstraint, paclet:ref/TimeConstraint])->(RefLink[Automatic, paclet:ref/Automatic]), (RefLink[PingTime, paclet:ref/PingTime]) will use the operating system's default timeout.

If a ping times out, (RefLink[PingTime, paclet:ref/PingTime]) returns (RefLink[$TimedOut, paclet:ref/$TimedOut]).

(RefLink[PingTime, paclet:ref/PingTime]) gives the ping time from the computer on which the kernel in which it is executed is running.

In some operating systems, specifications for (RefLink[TimeConstraint, paclet:ref/TimeConstraint]) may not strictly be adhered to.

OpenersPrimaryExamplesSection(Spacer1)Examples  (6)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Ping www.wolfram.com once:

PingTime["www.wolfram.com"]

Do so 10 times:

PingTime["www.wolfram.com",10]

OpenersExampleSection1(Spacer1)Scope  (2)

Ping the IPv4 loopback device:

PingTime[IPAddress["127.0.0.1"]]

Ping the IPv6 loopback device five times:

PingTime[IPAddress["::1"],5]

OpenersExampleSection2(Spacer1)Options  (2)

OpenersExampleSubsection0(Spacer1)UpdateInterval  (1)

Specify a wait between pings:

PingTime["www.wolfram.com",10,UpdateInterval->0.5]

Specify it in milliseconds:

PingTime["www.wolfram.com",10,UpdateInterval->Quantity[250,"Milliseconds"]]

OpenersExampleSubsection1(Spacer1)TimeConstraint  (1)

Specify a time constraint manually:

PingTime["www.wolfram.com",10,TimeConstraint->2]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

A slow or unresponsive host will return (RefLink[$TimedOut, paclet:ref/$TimedOut]):

PingTime["10.10.0.1",TimeConstraint->1]

An invalid host will return (RefLink[$Failed, paclet:ref/$Failed]):

PingTime["I.do.not.exist"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[URLResponseTime, paclet:ref/URLResponseTime])  ▪  (RefLink[IPAddress, paclet:ref/IPAddress])  ▪  (RefLink[HostLookup, paclet:ref/HostLookup])  ▪  (RefLink[AbsoluteTiming, paclet:ref/AbsoluteTiming])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Time Measurement & Optimization, paclet:guide/TimeMeasurementAndOptimization])}, {▪(RefLinkPlain[Web Operations, paclet:guide/WebOperations])}, {▪(RefLinkPlain[URL Manipulation, paclet:guide/URLManipulation])}, {▪(RefLinkPlain[Network Programming, paclet:guide/NetworkProgramming])}, {▪(RefLinkPlain[Tuning & Debugging, paclet:guide/TuningAndDebugging])}, {▪(RefLinkPlain[Internet and Computer Systems Data, paclet:guide/InternetAndWebRelatedData])}, {▪(RefLinkPlain[HTTP Requests & Responses, paclet:guide/HTTPRequestsAndResponses])}})}})