Skip to content

Commit 81fcdc7

Browse files
authored
Update auth.cpp
1 parent ec4586f commit 81fcdc7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

auth.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <stdexcept>
3838
#include <string>
3939
#include <array>
40+
#include <chrono>
4041

4142
#include <functional>
4243
#include <vector>
@@ -1085,6 +1086,7 @@ std::string get_str_between_two_str(const std::string& s,
10851086
}
10861087

10871088
std::string KeyAuth::api::req(std::string data, std::string url) {
1089+
auto timestart = std::chrono::high_resolution_clock::now();
10881090
CURL* curl = curl_easy_init();
10891091
if (!curl)
10901092
return XorStr("null");
@@ -1113,6 +1115,8 @@ std::string KeyAuth::api::req(std::string data, std::string url) {
11131115
if (code != CURLE_OK)
11141116
error(curl_easy_strerror(code));
11151117

1118+
auto timeend = std::chrono::high_resolution_clock::now();
1119+
KeyAuth::api::data.responsetime = std::chrono::duration_cast<std::chrono::milliseconds>(timestart - timeend).count();
11161120
return to_return;
11171121
}
11181122
void error(std::string message) {

0 commit comments

Comments
 (0)