CURLINFO_N...KUP_TIME_T(3)
π NAME π
okay so this is the CURLINFO_N...KUP_TIME_T(3) page from the Library Functions Manual, and itβs literally about CURLINFO_NAMELOOKUP_TIME_T β name lookup time in microseconds β¨
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_NAMELOOKUP_TIME_T,
curl_off_t *timep);
π¦ DESCRIPTION π¦
bestie, you pass a pointer to a curl_off_t, and it receives the total time in microseconds from the start until the name resolving was completed π
when a redirect is followed, the time from each request is added together, periodt β
also go peek at the TIMES overview in the curl_easy_getinfo(3) man page, iykyk π«Ά
π PROTOCOLS π
this functionality affects all supported protocols πΈ
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_off_t namelookup;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
result = curl_easy_perform(curl);
if(CURLE_OK == result) {
result = curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME_T,
&namelookup);
if(CURLE_OK == result) {
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", namelookup / 1000000,
(long)(namelookup % 1000000));
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
}
β AVAILABILITY β
added in curl 7.61.0 π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK, and non-zero means an error occurred β see libcurl-errors(3) for the deets π
π SEE ALSO π
xoxo, your libcurl bestie π β source/version: libcurl, dated 2026-10-12, page: CURLINFO_N...KUP_TIME_T(3) π¦
π¦ 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