1
0
mirror of synced 2025-09-07 00:46:38 +03:00

Initialize start time for server (#2220)

* Initialize start time for server

By initializing start_time_ for server, I hope to measure the time taken to process a request at the end maybe in the set_logger callback and print it.

I only see current usage in client with server retaining the inital min value

* Add test to verify start time is initialized

* Address review comments

* run clang format
This commit is contained in:
tejas
2025-08-27 01:04:13 +05:30
committed by GitHub
parent 3fae5f1473
commit b8e21eac89
2 changed files with 8 additions and 0 deletions

View File

@@ -8264,6 +8264,7 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
if (!line_reader.getline()) { return false; }
Request req;
req.start_time_ = std::chrono::steady_clock::now();
Response res;
res.version = "HTTP/1.1";