CURLINFO_A...ECT_TIME_T(3)
π CURLINFO_APPCONNECT_TIME_T β time until the SSL/SSH handshake completed
okay bestie, so this one is from section 3 of the Library Functions Manual, and it's giving "how long did the handshake drama take" energy β¨ lowkey one of the cutest little getinfo calls ngl.
β¨ NAME β¨
CURLINFO_APPCONNECT_TIME_T β the time until the SSL/SSH handshake completed, fr fr π
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_APPCONNECT_TIME_T,
curl_off_t *timep);
π¦ DESCRIPTION π¦
So the way this works π β you pass in a pointer to a curl_off_t, and it receives the time, in microseconds, that it took from the start until the SSL/SSH connect/handshake to the remote host was completed. Iconic. π
And like, highkey this time is most often close to the CURLINFO_PRETRANSFER_TIME_T(3) time, except for cases such as HTTP multiplexing where the pretransfer time can be delayed due to waits in line for the stream and more. so not always twins, ok? π
Also!! when a redirect is followed, the time from each request is added together. every hop counts bestie π
See also the TIMES overview in the curl_easy_getinfo(3) man page if you wanna go deeper, iykyk π
π PROTOCOLS π
This functionality affects all supported protocols β literally all of them, no gatekeeping π«Ά
π§ 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_APPCONNECT_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);
}
}
the /* always cleanup */ comment is there for a reason bestie, don't ghost your handle π
β AVAILABILITY β
Added in curl 7.61.0 β a lil vintage, but still slaying π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK β we love a zero π non-zero means an error occurred, so go check libcurl-errors(3) and figure out what went wrong, no cap.
π₯ SEE ALSO π₯
π that's the whole vibe. go measure your handshakes, bestie. periodt.
mwah β this gorgeous lil page is brought to you by libcurl, dated 2026-10-12. take care of her, she's iconic πβ¨π
π¦ 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