We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29eb2a1 commit 284d513Copy full SHA for 284d513
src/coro_rpc/benchmark/bench.cpp
@@ -92,10 +92,16 @@ async_simple::coro::Lazy<std::error_code> request(const bench_config& conf) {
92
});
93
}
94
95
+ std::cout << std::fixed << std::setprecision(2);
96
+
97
while (true) {
98
+ auto start = std::chrono::system_clock::now();
99
std::this_thread::sleep_for(std::chrono::seconds{1});
100
auto c = g_count.exchange(0);
- std::cout << "Throughput:" << 8.0 * c / 1000'000'000 << " Gb/s\n";
101
+ auto end = std::chrono::system_clock::now();
102
+ auto dur = (end - start) / std::chrono::milliseconds(1);
103
+ double val = (8.0 * c * 1000) / (1000'000'000ll * dur);
104
+ std::cout << "Throughput:" << val << " Gb/s\n";
105
106
107
0 commit comments