Skip to content
Snippets Groups Projects
Commit c339ade3 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Log send time

parent 4f7f9da9
No related branches found
No related tags found
1 merge request!37Resolves #83 net performance, partially
Pipeline #11549 passed
......@@ -563,12 +563,19 @@ int Peer::_send() {
#ifdef WIN32
// TODO(nick) Use WSASend instead as equivalent to writev
auto start = std::chrono::high_resolution_clock::now();
auto send_vec = send_buf_.vector();
auto send_size = send_buf_.vector_size();
int c = 0;
for (int i = 0; i < send_size; i++) {
c += ftl::net::internal::send(sock_, (char*)send_vec[i].iov_base, (int)send_vec[i].iov_len, 0);
}
std::chrono::duration<double> elapsed =
std::chrono::high_resolution_clock::now() - start;
LOG(INFO) << "SEND TIME: " << elapsed.count();
#else
int c = ftl::net::internal::writev(sock_, send_buf_.vector(), (int)send_buf_.vector_size());
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment