Skip to content

The underlying curl library measures how long different components of the request take to complete. This function retrieves that information.

Usage

resp_timing(resp)

Arguments

resp

A httr2 response object, created by req_perform().

Value

Named numeric vector of timing information. The names of the elements in this vector correspond to the names used in libcurl's curl_easy_getinfo() API. The most useful component is likely "total" (corresponding to CURLINFO_TOTAL_TIME), the overall time in seconds to complete the request including any redirects followed.

Examples

req <- request(example_url())
resp <- req_perform(req)
resp_timing(resp)
#>      redirect    namelookup       connect   pretransfer starttransfer 
#>      0.000000      0.000109      0.000230      0.000275      0.002806 
#>         total 
#>      0.003090