GNURLINFO_...DOWNLOAD_T(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

okay so you're on the GNURLINFO_...DOWNLOAD_T(3) page, which lives in the curl_easy_getinfo options section β€” and it's literally here to get your download speed. bestie, it's giving useful. πŸ’…βœ¨


🌸 NAME 🌸

CURLINFO_SPEED_DOWNLOAD_T β€” get download speed πŸ’–

πŸ’… SYNOPSIS πŸ’…

#include <gnurl/curl.h>

CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_DOWNLOAD_T,
       curl_off_t *speed);

πŸ¦‹ DESCRIPTION πŸ¦‹

The way that this works is you pass a pointer to a curl_off_t to receive the average download speed that curl measured for the complete download. Measured in bytes/second. periodt. πŸ“πŸ’«

🌈 PROTOCOLS 🌈

No protocols listed here, bestie β€” that's the whole section. it's giving empty section energy, no cap. πŸ’€πŸ« 

πŸŽ€ EXAMPLE πŸŽ€

okay so here's the little example, run it and print that speed:

CURL *curl = curl_easy_init();
       if(curl) {
         curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");

         /* Perform the request */
         res = curl_easy_perform(curl);

         if(!res) {
           curl_off_t speed;
           res = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD_T, &speed);
           if(!res) {
             printf("Download speed %" CURL_FORMAT_CURL_OFF_T " bytes/sec\n", speed);
           }
         }
       }

⭐ AVAILABILITY ⭐

Added in 7.55.0 β€” that's the version tea. πŸ«–πŸ‘‘

πŸ’€ RETURN VALUE πŸ’€

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. slay. βœ…

🫢 SEE ALSO 🫢

Go check out these other pages, bestie:


later, bestie! πŸ«ΆπŸ’‹ this page is from libcurl 7.44.0, dated 28 Aug 2015, and it's the GNURLINFO_...DOWNLOAD_T(3) manual page. mwah! πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from