From 2b084ddac4381f3daa74b0be426309c90e85d73a Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 5 Jun 2024 09:25:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B5=D0=B4=D0=BE=D1=87=D1=91?= =?UTF-8?q?=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/main.cpp b/main.cpp index 1ad4ce6..206f6ff 100644 --- a/main.cpp +++ b/main.cpp @@ -60,7 +60,7 @@ Input download(const string& address) if(curl) { CURLcode res; - double start; + double time; curl_easy_setopt(curl, CURLOPT_URL, address.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); @@ -69,10 +69,10 @@ Input download(const string& address) curl_easy_cleanup(curl); if (res == CURLE_OK) { - res = curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &start); + res = curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &time); if (CURLE_OK == res) { - cerr<<"Time: " << start; + cerr<<"Time to connect: " << time; } } @@ -82,40 +82,6 @@ Input download(const string& address) } } - -/*int main(int argc, char* argv[]) -{ - curl_global_init(CURL_GLOBAL_ALL); - Input input; - - if (argc > 1) - { - CURL* curl = curl_easy_init(); - - if(curl) - { - CURLcode res; - curl_easy_setopt(curl, CURLOPT_URL, argv[1]); - res = curl_easy_perform(curl); - - if (res != CURLE_OK) - { - cerr << curl_easy_strerror(res); - exit(1); - } - - curl_easy_cleanup(curl); - } - return 0; - } - - auto in = input_data(cin, true); - auto bins = make_histogram(in.numbers, in.bin_count); - show_histogram_svg(bins); - - return 0; -} */ - int main(int argc, char* argv[]) { Input input;