GNURLINFO...ECT_TIME_T(3)
β¨ NAME β¨
Okay bestie, welcome to the curl_easy_getinfo options corner of the gnurl manual β the page name up top is GNURLINFO...ECT_TIME_T(3). The main character here is CURLINFO_REDIRECT_TIME_T, and its whole thing is: get the time for all redirection steps. Periodt. π
π¦ SYNOPSIS π¦
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_REDIRECT_TIME_T,
curl_off_t *timep);
πΈ DESCRIPTION πΈ
So the vibe is: you pass a pointer to a curl_off_t to receive the total time, in microseconds, it took for all the redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started. CURLINFO_REDIRECT_TIME_T contains the complete execution time for multiple redirections. Literally the whole redirect-era timeline, bestie. π«Ά
Also see the TIMES overview in the curl_easy_getinfo(3) man page β yes, that's your required reading, iykyk. π
π PROTOCOLS π
All. Every single one, slay. π―
π₯ EXAMPLE π₯
curl = curl_easy_init();
if(curl) {
curl_off_t 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_T, &redirect);
if(CURLE_OK == res) {
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", redirect / 1000000,
(long)(redirect % 1000000));
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
β AVAILABILITY β
Added in 7.61.0. That's the era, iykyk. π
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Simple as that, no drama. π
π SEE ALSO π
That's the whole page, bestie π β source/version: libcurl 7.61.0, date: 28 Apr 2018, and the page name on the footer is GNURLINFO...ECT_TIME_T(3). Bye, ily! π«Άβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 2018, 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