diff options
Diffstat (limited to '3rdparty/benchmark/src/csv_reporter.cc')
-rw-r--r-- | 3rdparty/benchmark/src/csv_reporter.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/3rdparty/benchmark/src/csv_reporter.cc b/3rdparty/benchmark/src/csv_reporter.cc index d78a9dfb267..3f67d1de1e6 100644 --- a/3rdparty/benchmark/src/csv_reporter.cc +++ b/3rdparty/benchmark/src/csv_reporter.cc @@ -17,6 +17,7 @@ #include <cstdint> #include <iostream> #include <string> +#include <tuple> #include <vector> #include "string_util.h" @@ -42,7 +43,7 @@ bool CSVReporter::ReportContext(const Context& context) { std::cerr << "***WARNING*** Library was built as DEBUG. Timings may be " "affected.\n"; #endif - std::cout << "name,iterations,real_time,cpu_time,bytes_per_second," + std::cout << "name,iterations,real_time,cpu_time,time_unit,bytes_per_second," "items_per_second,label\n"; return true; } @@ -66,7 +67,10 @@ void CSVReporter::ReportRuns(std::vector<Run> const& reports) { } void CSVReporter::PrintRunData(Run const& run) { - double const multiplier = 1e9; // nano second multiplier + double multiplier; + const char* timeLabel; + std::tie(timeLabel, multiplier) = GetTimeUnitAndMultiplier(run.time_unit); + double cpu_time = run.cpu_accumulated_time * multiplier; double real_time = run.real_accumulated_time * multiplier; if (run.iterations != 0) { @@ -83,6 +87,7 @@ void CSVReporter::PrintRunData(Run const& run) { std::cout << run.iterations << ","; std::cout << real_time << ","; std::cout << cpu_time << ","; + std::cout << timeLabel << ","; if (run.bytes_per_second > 0.0) { std::cout << run.bytes_per_second; |