Use duration_cast to ensure that we are retrieving milliseconds inside SimulatorStats::operator<<

This commit is contained in:
Tyler Neely 2022-11-22 11:30:24 +00:00
parent 0b19b62b12
commit c8c72de6ac

View File

@ -30,7 +30,7 @@ struct SimulatorStats {
friend bool operator==(const SimulatorStats & /* lhs */, const SimulatorStats & /* rhs */) = default;
friend std::ostream &operator<<(std::ostream &in, const SimulatorStats &stats) {
auto elapsed_ms = stats.elapsed_time.count() / 1000;
auto elapsed_ms = std::chrono::duration_cast<std::chrono::milliseconds>(stats.elapsed_time).count() / 1000;
std::string formated = fmt::format(
"SimulatorStats {{ total_messages: {}, dropped_messages: {}, timed_out_requests: {}, total_requests: {}, "