CURLINFO_SPEED_UPLOAD_T.3 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. .\" generated by cd2nroff 0.1 from CURLINFO_SPEED_UPLOAD_T.md
  2. .TH CURLINFO_SPEED_UPLOAD_T 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLINFO_SPEED_UPLOAD_T \- get upload speed
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SPEED_UPLOAD_T,
  9. curl_off_t *speed);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a pointer to a \fIcurl_off_t\fP to receive the average upload speed that
  13. curl measured for the complete upload. Measured in bytes/second.
  14. .SH PROTOCOLS
  15. This functionality affects all supported protocols
  16. .SH EXAMPLE
  17. .nf
  18. int main(void)
  19. {
  20. CURL *curl = curl_easy_init();
  21. if(curl) {
  22. CURLcode res;
  23. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  24. /* Perform the request */
  25. res = curl_easy_perform(curl);
  26. if(!res) {
  27. curl_off_t speed;
  28. res = curl_easy_getinfo(curl, CURLINFO_SPEED_UPLOAD_T, &speed);
  29. if(!res) {
  30. printf("Upload speed %" CURL_FORMAT_CURL_OFF_T " bytes/sec\\n", speed);
  31. }
  32. }
  33. }
  34. }
  35. .fi
  36. .SH AVAILABILITY
  37. Added in curl 7.55.0
  38. .SH RETURN VALUE
  39. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  40. .SH SEE ALSO
  41. .BR CURLINFO_SPEED_DOWNLOAD_T (3),
  42. .BR curl_easy_getinfo (3),
  43. .BR curl_easy_setopt (3)