mirror of
https://github.com/google/benchmark.git
synced 2024-11-26 16:31:54 +00:00
Simplify printing of counters in console reporter.
This commit is contained in:
parent
8f69e4f6ce
commit
ef6b4fb857
|
@ -132,14 +132,10 @@ void ConsoleReporter::PrintRunData(const Run& result) {
|
|||
}
|
||||
|
||||
for (auto& c : result.counters) {
|
||||
auto const& s = HumanReadableNumber(c.second.value);
|
||||
if (c.second.flags & Counter::Flags::kIsRate) {
|
||||
std::string counter_rate = StrCat(HumanReadableNumber(c.second.value), "/s");
|
||||
printer(Out, COLOR_DEFAULT, " %s=%s", c.first.c_str(), counter_rate.c_str());
|
||||
}
|
||||
else {
|
||||
printer(Out, COLOR_DEFAULT, " %s=%s", c.first.c_str(), s.c_str());
|
||||
}
|
||||
std::string s = HumanReadableNumber(c.second.value);
|
||||
const char* unit = ((c.second.flags & Counter::Flags::kIsRate) ?
|
||||
"/s" : "");
|
||||
printer(Out, COLOR_DEFAULT, " %s=%s%s", c.first.c_str(), s.c_str(), unit);
|
||||
}
|
||||
|
||||
if (!rate.empty()) {
|
||||
|
|
Loading…
Reference in a new issue