Skip to content

Commit

Permalink
making sure we are using the same type of clock
Browse files Browse the repository at this point in the history
  • Loading branch information
KjellKod committed Dec 15, 2023
1 parent 8fa19df commit ab86782
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions benchmark/benchmark_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <chrono>
#include <future>
#include <iostream>
#include <cassert>
#include <string>
#include <vector>
#include "q/q_api.hpp"
Expand Down
10 changes: 5 additions & 5 deletions benchmark/benchmark_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ namespace {
void print_result(const benchmark_result& result) {
double average_call_time_ns = result.mean_msgs_per_second ? 1e9 / result.mean_msgs_per_second : 0;

std::cout << std::left << std::setw(2) << result.runs << ", "
<< std::setw(5) << result.num_producer_threads << ", "
std::cout << std::left << std::setw(6) << result.runs << ", "
<< std::setw(6) << result.num_producer_threads << ", "
<< std::setw(6) << result.num_consumer_threads << ", "
<< std::setw(16) << result.mean_msgs_per_second << ", "
<< std::setw(14) << result.min_msgs_per_second << ", "
<< std::setw(14) << result.max_msgs_per_second << ", "
<< std::setw(12) << result.mean_msgs_per_second << ", "
<< std::setw(12) << result.min_msgs_per_second << ", "
<< std::setw(12) << result.max_msgs_per_second << ", "
<< std::setw(10) << average_call_time_ns << ","
<< std::setw(30) << result.comment << std::endl;
}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/stopwatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace benchmark {
using milliseconds = std::chrono::milliseconds;
using microseconds = std::chrono::microseconds;
using nanoseconds = std::chrono::nanoseconds;
using clock = std::chrono::steady_clock;
using clock = std::chrono::high_resolution_clock;
clock::time_point start_;

stopwatch() :
Expand Down

0 comments on commit ab86782

Please sign in to comment.