1CURLINFO_NAMELOOKUP_TIME(3)curl_easy_getinfo optionsCURLINFO_NAMELOOKUP_TIME(3)
2
3
4
6 CURLINFO_NAMELOOKUP_TIME - get the name lookup time
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_NAMELOOKUP_TIME, dou‐
12 ble *timep);
13
15 Pass a pointer to a double to receive the total time in seconds from
16 the start until the name resolving was completed.
17
18 See also the TIMES overview in the curl_easy_getinfo(3) man page.
19
21 All
22
24 curl = curl_easy_init();
25 if(curl) {
26 double namelookup;
27 curl_easy_setopt(curl, CURLOPT_URL, url);
28 res = curl_easy_perform(curl);
29 if(CURLE_OK == res) {
30 res = curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME, &namelookup);
31 if(CURLE_OK == res) {
32 printf("Time: %.1f", namelookup);
33 }
34 }
35 /* always cleanup */
36 curl_easy_cleanup(curl);
37 }
38
40 Added in 7.4.1
41
43 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
44 if not.
45
47 curl_easy_getinfo(3), curl_easy_setopt(3),
48 CURLINFO_NAMELOOKUP_TIME_T(3)
49
50
51
52libcurl 7.61.1 May 17, 2018 CURLINFO_NAMELOOKUP_TIME(3)