diff options
author | Ismael <ijimenezm@hotmail.es> | 2016-06-02 22:01:31 +0200 |
---|---|---|
committer | Ismael <ijimenezm@hotmail.es> | 2016-06-02 22:01:31 +0200 |
commit | 22cb9d9ce0ff12219f5ca6c4a28124d11730e66f (patch) | |
tree | ac81e6bfbfb9d0e39be5f7cf7d2f3cede14edf68 /src/console_reporter.cc | |
parent | 109f528a4039c298e1f02ff4ce2fd32c552c5a38 (diff) | |
download | google-benchmark-22cb9d9ce0ff12219f5ca6c4a28124d11730e66f.tar.gz |
google formated
Diffstat (limited to 'src/console_reporter.cc')
-rw-r--r-- | src/console_reporter.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/console_reporter.cc b/src/console_reporter.cc index 2783097..080c324 100644 --- a/src/console_reporter.cc +++ b/src/console_reporter.cc @@ -15,9 +15,9 @@ #include "benchmark/reporter.h" #include "complexity.h" +#include <algorithm> #include <cstdint> #include <cstdio> -#include <algorithm> #include <iostream> #include <string> #include <tuple> @@ -62,8 +62,8 @@ void ConsoleReporter::ReportRuns(const std::vector<Run>& reports) { void ConsoleReporter::PrintRunData(const Run& result) { auto& Out = GetOutputStream(); - auto name_color = (result.report_big_o || result.report_rms) - ? COLOR_BLUE : COLOR_GREEN; + auto name_color = + (result.report_big_o || result.report_rms) ? COLOR_BLUE : COLOR_GREEN; ColorPrintf(Out, name_color, "%-*s ", name_field_width_, result.benchmark_name.c_str()); @@ -84,25 +84,25 @@ void ConsoleReporter::PrintRunData(const Run& result) { if (result.items_per_second > 0) { items = StrCat(" ", HumanReadableNumber(result.items_per_second), " items/s"); - } + } const double real_time = result.GetAdjustedRealTime(); const double cpu_time = result.GetAdjustedCPUTime(); - if(result.report_big_o) { + if (result.report_big_o) { std::string big_o = GetBigOString(result.complexity); - ColorPrintf(Out, COLOR_YELLOW, "%10.2f %s %10.2f %s ", - real_time, big_o.c_str(), cpu_time, big_o.c_str()); - } else if(result.report_rms) { - ColorPrintf(Out, COLOR_YELLOW, "%10.0f %% %10.0f %% ", - real_time * 100, cpu_time * 100); + ColorPrintf(Out, COLOR_YELLOW, "%10.2f %s %10.2f %s ", real_time, + big_o.c_str(), cpu_time, big_o.c_str()); + } else if (result.report_rms) { + ColorPrintf(Out, COLOR_YELLOW, "%10.0f %% %10.0f %% ", real_time * 100, + cpu_time * 100); } else { const char* timeLabel = GetTimeUnitString(result.time_unit); - ColorPrintf(Out, COLOR_YELLOW, "%10.0f %s %10.0f %s ", - real_time, timeLabel, cpu_time, timeLabel); + ColorPrintf(Out, COLOR_YELLOW, "%10.0f %s %10.0f %s ", real_time, timeLabel, + cpu_time, timeLabel); } - if(!result.report_big_o && !result.report_rms) { + if (!result.report_big_o && !result.report_rms) { ColorPrintf(Out, COLOR_CYAN, "%10lld", result.iterations); } |