From ef0fcfca11ee309ffeced74ebef9a786d726096e Mon Sep 17 00:00:00 2001 From: "PARZIVAL (BreganIM)" Date: Mon, 19 May 2025 16:10:13 +0300 Subject: [PATCH] =?UTF-8?q?code:=D0=97=D0=B0=D1=89=D0=B8=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- laba01upd3.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/laba01upd3.cpp b/laba01upd3.cpp index a8c195c..666543b 100644 --- a/laba01upd3.cpp +++ b/laba01upd3.cpp @@ -39,7 +39,7 @@ static size_t write_data(void* items, size_t item_size, size_t item_count, void* Input download(const string& address) { stringstream buffer; CURL* curl = curl_easy_init(); - + curl_easy_setopt(curl, CURLOPT_URL, address.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); @@ -49,6 +49,11 @@ Input download(const string& address) { curl_easy_cleanup(curl); exit(1); } + + double download_speed = 0.0; + curl_easy_getinfo(curl, CURLINFO_SPEED_DOWNLOAD, &download_speed); + cerr << "Download speed: " << download_speed << " bytes/sec\n"; + curl_easy_cleanup(curl); return input_data(buffer, false); }