CURLINFO_REDIRECT_TIME(3)
π CURLINFO_REDIRECT_TIME π
ok so real talk bestie, you're reading the CURLINFO_REDIRECT_TIME(3) page from the Library Functions Manual and honestly? it's a good one. let's get into it π
β¨ NAME β¨
CURLINFO_REDIRECT_TIME β literally the time for all the redirection steps, every single one of them π
π¦ SYNOPSIS π¦
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_TIME,
double *timep);
πΈ DESCRIPTION πΈ
okay so you pass a pointer to a double β like, an actual double * β and it gets filled in with the total time, in seconds, that it took for all the redirection steps π«Ά
and when we say all the steps, we mean all of them no cap: name lookup, connect, pretransfer, and transfer β everything that happened before the final transaction was started. the whole lil journey before the main event, iykyk β¨
and bestie, CURLINFO_REDIRECT_TIME(3) contains the complete execution time for multiple redirections β so if you got bounced around like five times, this is the grand total of all that bouncing π
also!! peep the TIMES overview section in the curl_easy_getinfo(3) man page, it's giving bonus lore π
π PROTOCOLS π
this functionality affects http only π periodt
π₯ EXAMPLE π₯
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
double redirect;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
result = curl_easy_perform(curl);
if(CURLE_OK == result) {
result = curl_easy_getinfo(curl, CURLINFO_REDIRECT_TIME, &redirect);
if(CURLE_OK == result) {
printf("Time: %.1f", redirect);
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
}
main character energy fr fr π notice the /* always cleanup */ comment β that's not decoration bestie, that's a lifestyle π§
β AVAILABILITY β
added in curl 7.9.7 β she's been iconic for a minute π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode indicating success or error, okurrr π
CURLE_OK(0) β means everything was OK, slay π- non-zero β means an error occurred π see
libcurl-errors(3)for the deets
π SEE ALSO π
CURLINFO_REDIRECT_COUNT(3)CURLINFO_REDIRECT_TIME_T(3)CURLINFO_REDIRECT_URL(3)curl_easy_getinfo(3)curl_easy_setopt(3)
alright bestie that's the whole page, go measure some redirects π β¨
libcurl Β· 2026-10-12 Β· CURLINFO_REDIRECT_TIME(3) β mwah, ily, go read the source π«Άπ
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms