1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLINFO_SPEED_UPLOAD
5Section: 3
6Source: libcurl
7See-also:
8  - CURLINFO_SPEED_DOWNLOAD_T (3)
9  - curl_easy_getinfo (3)
10  - curl_easy_setopt (3)
11Protocol:
12  - All
13---
14
15# NAME
16
17CURLINFO_SPEED_UPLOAD - get upload speed
18
19# SYNOPSIS
20
21~~~c
22#include <curl/curl.h>
23
24CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_UPLOAD, double *speed);
25~~~
26
27# DESCRIPTION
28
29Pass a pointer to a double to receive the average upload speed that curl
30measured for the complete upload. Measured in bytes/second.
31
32CURLINFO_SPEED_UPLOAD_T(3) is a newer replacement that returns a more
33sensible variable type.
34
35# EXAMPLE
36
37~~~c
38int main(void)
39{
40  CURL *curl = curl_easy_init();
41  if(curl) {
42    CURLcode res;
43    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
44
45    /* Perform the request */
46    res = curl_easy_perform(curl);
47
48    if(!res) {
49      double speed;
50      res = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD, &speed);
51      if(!res) {
52        printf("Upload speed %.0f bytes/sec\n", speed);
53      }
54    }
55  }
56}
57~~~
58
59# AVAILABILITY
60
61Added in 7.4.1. Deprecated since 7.55.0.
62
63# RETURN VALUE
64
65Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
66