1CURLINFO_CONNECT_TIME(3) curl_easy_getinfo options CURLINFO_CONNECT_TIME(3)
2
3
4
6 CURLINFO_CONNECT_TIME - get the time until connect
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONNECT_TIME, double
12 *timep);
13
15 Pass a pointer to a double to receive the total time in seconds from
16 the start until the connection to the remote host (or proxy) was com‐
17 pleted.
18
19 See also the TIMES overview in the curl_easy_getinfo(3) man page.
20
22 All
23
25 curl = curl_easy_init();
26 if(curl) {
27 double connect;
28 curl_easy_setopt(curl, CURLOPT_URL, url);
29 res = curl_easy_perform(curl);
30 if(CURLE_OK == res) {
31 res = curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &connect);
32 if(CURLE_OK == res) {
33 printf("Time: %.1f", connect);
34 }
35 }
36 /* always cleanup */
37 curl_easy_cleanup(curl);
38 }
39
41 Added in 7.4.1
42
44 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
45 if not.
46
48 curl_easy_getinfo(3), curl_easy_setopt(3), CURLINFO_CONNECT_TIME_T(3)
49
50
51
52libcurl 7.64.0 May 17, 2018 CURLINFO_CONNECT_TIME(3)