CURLINFO_CONNECT_TIME_T(3)
okay so bestie ๐
welcome to CURLINFO_CONNECT_TIME_T(3) โ it's from the Library Functions Manual โจ. This page is literally about time to connect โฑ๏ธ and it's giving โstopwatch but make it curlโ ๐ซถ.
๐ธ NAME ๐ธ
CURLINFO_CONNECT_TIME_T โ time to connect โณ
โจ SYNOPSIS โจ
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONNECT_TIME_T,
curl_off_t *timep);
๐ DESCRIPTION ๐
You pass a pointer to a curl_off_t and it receives the total time in microseconds from the start until the connection to the remote host (or proxy) was completed โฒ๏ธ. No cap, that's the whole vibe.
When a redirect is followed, the time from each request is added together ๐งฎ โ yes, all of them, summed.
Also peek at the TIMES overview in the curl_easy_getinfo(3) man page ๐.
๐ฆ PROTOCOLS ๐ฆ
This functionality affects all supported protocols ๐.
๐ EXAMPLE ๐
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_off_t connect;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
result = curl_easy_perform(curl);
if(CURLE_OK == result) {
result = curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME_T, &connect);
if(CURLE_OK == result) {
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", connect / 1000000,
(long)(connect % 1000000));
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
}
โญ AVAILABILITY โญ
Added in curl 7.61.0 ๐.
๐ RETURN VALUE ๐
curl_easy_getinfo(3)returns aCURLcodeindicating success or error.CURLE_OK(0) means everything was OK, non-zero means an error occurred, seelibcurl-errors(3).
๐ SEE ALSO ๐
mwah ๐ and that's the tea โ this page is from libcurl, dated 2026-10-12, and the title is CURLINFO_CONNECT_TIME_T(3) ๐โจ.
๐ฆ 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