CURLINFO_STARTTRANSFER_TIME_T(3)
π CURLINFO_STARTTRANSFER_TIME_T(3) β like, the Library Functions Manual page, bestie β¨
okay so this is the libcurl manual page for CURLINFO_STARTTRANSFER_TIME_T, and no cap it's about to make timing make sense. it's a "Library Functions Manual" situation, so grab a lil snack and let's go π
πΈ NAME πΈ
CURLINFO_STARTTRANSFER_TIME_T β the time it takes to first byte received, literally π«Ά
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_STARTTRANSFER_TIME_T,
curl_off_t *timep);
π DESCRIPTION π
so you pass a pointer to a curl_off_t, right? and it receives the time β in microseconds β±οΈ β that it took from the start until the first byte is received by libcurl. iconic.
and the way this one includes CURLINFO_PRETRANSFER_TIME_T(3) too?? plus the time the server needs to calculate the result. like, it's giving full picture energy, not just the cute little byte moment π
when a redirect is followed, the time from each request is added together. every single one. summed. periodt.
also!! go look at the TIMES overview in the curl_easy_getinfo(3) man page, there's a whole vibe check waiting for you there π
π¦ PROTOCOLS π¦
this functionality affects all supported protocols β all of them, no gatekeeping π
π EXAMPLE π
okay this is the part where you copy this exactly, i'm serious π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_off_t start;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
result = curl_easy_perform(curl);
if(CURLE_OK == result) {
result = curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME_T, &start);
if(CURLE_OK == result) {
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", start / 1000000,
(long)(start % 1000000));
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
}
see that /* always cleanup */ comment? that's not decoration bestie, that's a lifestyle π§
β AVAILABILITY β
added in curl 7.61.0 β so it's been around, it's got history, it ate π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode indicating success or error. simple.
CURLE_OK(0) means everything was OK β slay π- non-zero means an error occurred β not slay π β see
libcurl-errors(3)
π SEE ALSO π
lowkey reminder: this is genuinely real documentation behaviour, so if your timing math looks weird, go reread the DESCRIPTION, it's all in there fr fr π
k that's the page!! this came from the libcurl manual, dated 2026-10-12, and the page is CURLINFO_S...SFER_TIME_T(3) (yes the header really truncates it like that, we don't make the rules π
). go get those microseconds, bestie π¦β¨
π¦ 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