CURLINFO_TOTAL_TIME_T(3)
π CURLINFO_TOTAL_TIME_T(3) π
okay so bestie, this one is a libcurl manpage β like, from the Library Functions Manual β and it's about grabbing the total time of your last transfer. yes, the whole thing. every last microsecond. let's get into it π«Ά
β¨ NAME β¨
CURLINFO_TOTAL_TIME_T β total time of previous transfer
π SYNOPSIS π
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_TOTAL_TIME_T,
curl_off_t *timep);
π DESCRIPTION π
So here's the vibe: you pass a pointer to a curl_off_t, and it receives the total time in microseconds for the previous transfer β and when we say total, we mean total total. name resolving? included. TCP connect? included. the whole journey, no cap. π«
The curl_off_t represents the time in microseconds. literally that's the unit, bestie.
And when a redirect is followed, the time from each request is added together β so it's the sum of the whole little adventure, not just the last hop. the way that adds up π
also go peek at the TIMES overview in the curl_easy_getinfo(3) man page, it's giving essential reading π
π¦ PROTOCOLS π¦
This functionality affects all supported protocols. all of them. every single one. periodt π
πΈ EXAMPLE πΈ
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_off_t total;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
result = curl_easy_perform(curl);
if(CURLE_OK == result) {
result = curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME_T, &total);
if(CURLE_OK == result) {
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", total / 1000000,
(long)(total % 1000000));
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
}
look at that printf doing the microseconds-to-seconds math, absolutely iconic formatting behavior π
β AVAILABILITY β
Added in curl 7.61.0. so if your curl is older than that, she doesn't know this function and you're gonna have a bad time π
π§ RETURN VALUE π§
curl_easy_getinfo(3) returns a CURLcode indicating success or error.
CURLE_OK(0) means everything was OK β slay π- non-zero means an error occurred β see
libcurl-errors(3)for the whole saga
π₯ SEE ALSO π₯
k bye bestie, go time your transfers π this page came from libcurl, dated 2026-10-12 β mwah, catch you on the next manpage πβ¨
π¦ 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