GNURLINFO_CONNECT_TIME(3)
π¦ GNURLINFO_CONNECT_TIME(3) π¦
okay so bestie, welcome to the GNURLINFO_CONNECT_TIME(3) page β it lives in the curl_easy_getinfo options manual section, and itβs literally all about timing your connection. no cap, this one is short and sweet. π
β¨ NAME β¨
CURLINFO_CONNECT_TIME β get the time until connect β±οΈβ¨
π» SYNOPSIS π»
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONNECT_TIME, double
*timep);
πΈ DESCRIPTION πΈ
okay so you pass a pointer to a double, and it receives the total time in seconds from the start until the connection to the remote host (or proxy) was completed. π«Ά
when a redirect is followed, the time from each request is added together. yes bestie, it stacks. π
also check out the TIMES overview in the curl_easy_getinfo(3) man page β thatβs where the timing lore lives. π
π PROTOCOLS π
All π― β every protocol, no gatekeeping.
π EXAMPLE π
curl = curl_easy_init();
if(curl) {
double connect;
curl_easy_setopt(curl, CURLOPT_URL, url);
res = curl_easy_perform(curl);
if(CURLE_OK == res) {
res = curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &connect);
if(CURLE_OK == res) {
printf("Time: %.1f", connect);
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
π¦ AVAILABILITY π¦
Added in 7.4.1 β vintage but iconic. β¨
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. thatβs the whole vibe check. π
π₯ SEE ALSO π₯
mwah π okay bestie, thatβs the page. this one is from libcurl 7.44.0, dated 28 Aug 2015, and the footer title is GNURLINFO_CONNECT_TIME(3) β bye, love you, go time those connections fr fr π«Άβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 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