Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 088f2651 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Floss: Log time spent in closing socket" into main

parents 6a02fcf4 e67113ce
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@

#include <chrono>  // NOLINT
#include <csignal>
#include <cstdint>
#include <mutex>  // NOLINT
#include <queue>
#include <utility>
@@ -369,7 +370,11 @@ protected:
      std::lock_guard<std::mutex> incoming_packet_callback_lock(incoming_packet_callback_mutex_);
      incoming_packet_callback_ = nullptr;
    }
    auto start = std::chrono::high_resolution_clock::now();
    ::close(sock_fd_);
    auto end = std::chrono::high_resolution_clock::now();
    int64_t duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
    log::info("Spent {} milliseconds on closing socket", duration);
    sock_fd_ = INVALID_FD;
    log::info("HAL is closed");
  }