GNURLINFO_REDIRECT_TIME(3)
π GNURLINFO_REDIRECT_TIME π
okay bestie, welcome to this little corner of the curl_easy_getinfo options manual β todayβs main character is GNURLINFO_REDIRECT_TIME(3) β¨
πΈ NAME πΈ
CURLINFO_REDIRECT_TIME β get the time for all redirection steps ππ
π¦ SYNOPSIS π¦
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_TIME, double
*timep);
π DESCRIPTION π
So the vibe is: you pass a pointer to a double, and it receives the total time, in seconds, that it took for all redirection steps β name lookup, connect, pretransfer, and transfer β before the final transaction was started. No cap, thatβs the whole timeline tea ββ¨
CURLINFO_REDIRECT_TIME contains the complete execution time for multiple redirections β sheβs tracking the whole redirect saga, not just one tiny moment π
Also, thereβs a TIMES overview in the curl_easy_getinfo(3) man page β go peek if you want the full context π«Ά
π PROTOCOLS π
All πβ¨
π EXAMPLE π
hereβs the code vibe, copy it exactly and let it slay:
curl = curl_easy_init();
if(curl) {
double redirect;
curl_easy_setopt(curl, CURLOPT_URL, url);
res = curl_easy_perform(curl);
if(CURLE_OK == res) {
res = curl_easy_getinfo(curl, CURLINFO_REDIRECT_TIME, &redirect);
if(CURLE_OK == res) {
printf("Time: %.1f", redirect);
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
β AVAILABILITY β
Added in 7.9.7 β yes, sheβs got history ππ
π RETURN VALUE π
- Returns
CURLE_OKif the option is supported β - Returns
CURLE_UNKNOWN_OPTIONif not π
π§ SEE ALSO π§
mwah π this page is brought to you by libcurl 7.44.0, dated 28 Aug 2015, and filed under GNURLINFO_REDIRECT_TIME(3) πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms