GNURLINFO_...DOWNLOAD_T(3)
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
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, 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