GNURLINFO_...FER_TIME_T(3)
π GNURLINFO_...FER_TIME_T π
ok so this is one of the pages from the curl_easy_getinfo options section β the manual family is literally called GNURLINFO_...FER_TIME_T(3), which is a mouthful, but you're gonna be fine bestie π«Ά
β¨ NAME β¨
CURLINFO_PRETRANSFER_TIME_T β get the time until the file transfer start π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PRETRANSFER_TIME_T,
curl_off_t *timep);
β¨ DESCRIPTION β¨
sooo you pass in a pointer to a curl_off_t and it gets filled with the time β in microseconds β that it took from the very start until the file transfer is just about to begin. literally the "omg we're almost there" moment β
this number includes all the pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. like all the little handshake-y stuff that's specific to whatever protocol you're on π
it does not involve the sending of the protocol-specific request that triggers a transfer. nope, that's not in here, that's a whole different vibe π
when a redirect is followed, the time from each request is added together. so redirects stack up, fr fr π§
also go peek at the TIMES overview in the curl_easy_getinfo(3) man page, it's giving helpful β¨
β¨ PROTOCOLS β¨
All π (every single one, no cap)
β¨ EXAMPLE β¨
curl = curl_easy_init();
if(curl) {
curl_off_t pretransfer;
curl_easy_setopt(curl, CURLOPT_URL, url);
res = curl_easy_perform(curl);
if(CURLE_OK == res) {
res = curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME_T, &pretransfer);
if(CURLE_OK == res) {
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", pretransfer / 1000000,
(long)(pretransfer % 1000000));
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
β¨ AVAILABILITY β¨
added in 7.61.0 π if you're on anything older, she's not there bestie, sorry π
β¨ RETURN VALUE β¨
returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not π
like, if you get CURLE_UNKNOWN_OPTION it's not you, it's the version π
β¨ SEE ALSO β¨
πΈ ok that's the whole page, mwah π«Ά this was libcurl 7.61.0, dated 28 Apr 2018 β and the manual it lives in is the GNURLINFO_...FER_TIME_T(3) one. go measure your microseconds, main character ππ¦
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 2018 - 2019, 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