GNURLINFO...KUP_TIME_T(3)
π¦ GNURLINFO...KUP_TIME_T(3) π¦
okay so bestie, you found the manual page for GNURLINFO...KUP_TIME_T(3) in the curl_easy_getinfo options manual, and it is literally all about getting the name lookup time in microseconds. tiny units, big main character energy β¨
πΈ NAME πΈ
CURLINFO_NAMELOOKUP_TIME_T β get the name lookup time in microseconds π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_NAMELOOKUP_TIME_T,
curl_off_t *timep);
π DESCRIPTION π
okay so 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. lowkey precise, highkey useful π«Ά
When a redirect is followed, the time from each request is added together. no cap, it stacks π
also go peek at the TIMES overview in the curl_easy_getinfo(3) man page β itβs giving the big picture π
π¦ PROTOCOLS π¦
All β every single protocol, slay β¨
π EXAMPLE π
curl = curl_easy_init();
if(curl) {
curl_off_t namelookup;
curl_easy_setopt(curl, CURLOPT_URL, url);
res = curl_easy_perform(curl);
if(CURLE_OK == res) {
res = curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME_T, &namelookup);
if(CURLE_OK == res) {
printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", namelookup / 1000000,
(long)(namelookup % 1000000));
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
π AVAILABILITY π
Added in 7.61.0 β periodt π
π₯ RETURN VALUE π₯
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. thatβs the whole vibe check, bestie π
π SEE ALSO π
curl_easy_getinfo(3), curl_easy_setopt(3), CURLINFO_NAMELOOKUP_TIME(3) β go read them, iykyk π«Ά
xoxo, your Unix bestie π β source/version: libcurl 7.61.0, date: 28 Apr 2018, footer title: GNURLINFO...KUP_TIME_T(3). now go get those microseconds, bestie π¦
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 2018 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms