1CURLINFO_SPEED_DOWNLOAD(3) curl_easy_getinfo optionsCURLINFO_SPEED_DOWNLOAD(3)
2
3
4

NAME

6       CURLINFO_SPEED_DOWNLOAD - get download speed
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode  curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_DOWNLOAD, dou‐
12       ble *speed);
13

DESCRIPTION

15       Pass a pointer to a double to receive the average download  speed  that
16       curl measured for the complete download. Measured in bytes/second.
17
18       CURLINFO_SPEED_DOWNLOAD_T(3) is a newer replacement that returns a more
19       sensible variable type.
20

PROTOCOLS

EXAMPLE

23       CURL *curl = curl_easy_init();
24       if(curl) {
25         curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
26
27         /* Perform the request */
28         res = curl_easy_perform(curl);
29
30         if(!res) {
31           double speed;
32           res = curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &speed);
33           if(!res) {
34             printf("Download speed %.0f bytes/sec\n", ul);
35           }
36         }
37       }
38

AVAILABILITY

40       Added in 7.4.1
41

RETURN VALUE

43       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
44       if not.
45

SEE ALSO

47       curl_easy_getinfo(3),   curl_easy_setopt(3),  CURLINFO_SPEED_UPLOAD(3),
48       CURLINFO_SIZE_UPLOAD_T(3),
49
50
51
52libcurl 7.71.1                   June 15, 2017      CURLINFO_SPEED_DOWNLOAD(3)
Impressum