URLResponseTime

URLResponseTime[url]

gives the total number of seconds to request one byte from the specified URL.

URLResponseTime[url,prop]

gives the specified timing.

Details and Options

  • The URL may be specified as "url" or URL["url"]. IPAddress["host:protocol"] is also supported.
  • The URL given can be just a host name, in which case the default HTTP port (80) is assumed.
  • If a URL cannot be reached, URLResponseTime returns $Failed.
  • Possible properties in URLResponseTime include:
  • Allan association of all timings
    "ConnectionTimes"an association of timings related to connection steps
    "HostConnection"time until connection to host is established
    "HTTPRedirect"time spent on all redirection steps, if any
    "NameLookup"time until DNS lookup completed
    "PreTransfer"time to complete all steps prior to data transfer initiation
    "SSLHandshake"time until SSL handshake completed
    "TransactionTotal"total time for the complete request
    "TransferInitiation"time until the first byte of data is received
  • URLResponseTime[url] is equivalent to URLResponseTime[url,"TransactionTotal"].
  • URLResponseTime takes the following option:
  • TimeConstraint60time to wait for URL to respond
  • Option settings t are interpreted as t seconds. Settings involving Quantity can also be used.

Examples

open allclose all

Basic Examples  (1)

Find how long it takes to receive a byte from www.wolfram.com:

Scope  (6)

DNS lookup time:

Find the time elapsed to make a connection:

Find the time to complete the SSL handshake:

Elapsed time from start until the first byte is received:

Total time to complete the request:

Find all elapsed times:

Request only times related to connecting to the host:

URLResponseTime supports IPAddress objects:

Options  (1)

TimeConstraint  (1)

Properties & Relations  (2)

"TransactionTotal" is the default property:

URLResponseTime[host] will report the time to open a connection to the web server:

PingTime gives the time to ping the host without opening any connection:

When both are available, PingTime will generally be faster:

Introduced in 2017
 (11.1)