1CURLINFO_APPCONNECT_TIME(3)curl_easy_getinfo optionsCURLINFO_APPCONNECT_TIME(3)
2
3
4
6 CURLINFO_APPCONNECT_TIME - get the time until the SSL/SSH handshake is
7 completed
8
10 #include <curl/curl.h>
11
12 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_APPCONNECT_TIME, dou‐
13 ble *timep);
14
16 Pass a pointer to a double to receive the time, in seconds, it took
17 from the start until the SSL/SSH connect/handshake to the remote host
18 was completed. This time is most often very near to the CURLINFO_PRE‐
19 TRANSFER_TIME(3) time, except for cases such as HTTP pipelining where
20 the pretransfer time can be delayed due to waits in line for the pipe‐
21 line and more.
22
23 See also the TIMES overview in the curl_easy_getinfo(3) man page.
24
26 All
27
29 curl = curl_easy_init();
30 if(curl) {
31 double connect;
32 curl_easy_setopt(curl, CURLOPT_URL, url);
33 res = curl_easy_perform(curl);
34 if(CURLE_OK == res) {
35 res = curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME, &connect);
36 if(CURLE_OK == res) {
37 printf("Time: %.1f", connect);
38 }
39 }
40 /* always cleanup */
41 curl_easy_cleanup(curl);
42 }
43
45 Added in 7.19.0
46
48 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
49 if not.
50
52 curl_easy_getinfo(3), curl_easy_setopt(3), CURLINFO_APPCON‐
53 NECT_TIME_T(3)
54
55
56
57libcurl 7.61.1 May 17, 2018 CURLINFO_APPCONNECT_TIME(3)