From 3a0651cc1aefa3fd9e07e70f7433ab26ab340bcc Mon Sep 17 00:00:00 2001 From: MatusSV Date: Mon, 27 May 2024 10:43:54 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BA=D0=BE=D0=B4=20=D0=B4=D0=BB=D1=8F=20=D0=B2?= =?UTF-8?q?=D0=B0=D1=80=D0=B8=D0=B0=D0=BD=D1=82=D0=B0=2016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index caf6efe..e8bfde7 100644 --- a/main.cpp +++ b/main.cpp @@ -36,8 +36,8 @@ input_data(istream& in_stream,bool prompt) { in.colors.resize(in.bin_count); for (size_t i = 0; i < in.bin_count; i++) { - in_stream >> in.colors[i]; - //in.colors[i]="red"; + //in_stream >> in.colors[i]; + in.colors[i]="red"; bool check = check_color(in.colors[i]); while (!check) { if (prompt) cerr << "Incorrect input. Color doesn't contain # or has spaces." << endl; @@ -75,10 +75,18 @@ Input download(const string& address) { curl_easy_setopt(curl, CURLOPT_HEADERDATA, NULL); res = curl_easy_perform(curl); curl_easy_cleanup(curl); + if (res != CURLE_OK) { cout << curl_easy_strerror(res); exit(1); } + else + { + double *ct; + res = curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &ct); + if((CURLE_OK == res) && ct) + printf("Time: %f\n",ct); + } } return input_data(buffer, false);