resp_timing: Extract timing data

View source: R/resp-timing.R

resp_timingR Documentation

Extract timing data

Description

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)

httr2 documentation built on Aug. 8, 2025, 7:52 p.m.