PingTime

PingTime[host]

gives the round-trip ping time for the specified network host.

PingTime[host,n]

gives a list of times for n successive pings.

Details and Options

  • PingTime[host] uses standard ICMP datagrams. The host may be specified as "hostname" or IPAddress["addr"].
  • Times are reported in milliseconds.
  • PingTime takes the following options:
  • TimeConstraint Automatictime to wait for a ping to return
    UpdateInterval 0time to wait between pings
  • Option settings t are interpreted as t seconds. Settings involving Quantity can also be used.
  • The setting UpdateInterval->t specifies that PingTime will wait for time t after a reply packet is received before sending out the next ping.
  • With the default set of TimeConstraint->Automatic, PingTime will use the operating system's default timeout.
  • If a ping times out, PingTime returns $TimedOut.
  • 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 TimeConstraint may not strictly be adhered to.

Examples

open allclose all

Basic Examples  (1)

Ping www.wolfram.com once:

Do so 10 times:

Scope  (2)

Ping the IPv4 loopback device:

Ping the IPv6 loopback device five times:

Options  (2)

TimeConstraint  (1)

Specify a time constraint manually:

UpdateInterval  (1)

Specify a wait between pings:

Specify it in milliseconds:

Properties & Relations  (1)

A slow or unresponsive host will return $TimedOut:

An invalid host will return $Failed:

Wolfram Research (2016), PingTime, Wolfram Language function, https://reference.wolfram.com/language/ref/PingTime.html.

Text

Wolfram Research (2016), PingTime, Wolfram Language function, https://reference.wolfram.com/language/ref/PingTime.html.

CMS

Wolfram Language. 2016. "PingTime." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PingTime.html.

APA

Wolfram Language. (2016). PingTime. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PingTime.html

BibTeX

@misc{reference.wolfram_2024_pingtime, author="Wolfram Research", title="{PingTime}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/PingTime.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_pingtime, organization={Wolfram Research}, title={PingTime}, year={2016}, url={https://reference.wolfram.com/language/ref/PingTime.html}, note=[Accessed: 21-November-2024 ]}