GNURLINFO...ECT_TIME_T(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

✨ 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