summaryrefslogtreecommitdiffstats
path: root/libcxx/utils/google-benchmark/src/reporter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/utils/google-benchmark/src/reporter.cc')
-rw-r--r--libcxx/utils/google-benchmark/src/reporter.cc31
1 files changed, 12 insertions, 19 deletions
diff --git a/libcxx/utils/google-benchmark/src/reporter.cc b/libcxx/utils/google-benchmark/src/reporter.cc
index 5187859074f..64742426cd3 100644
--- a/libcxx/utils/google-benchmark/src/reporter.cc
+++ b/libcxx/utils/google-benchmark/src/reporter.cc
@@ -13,13 +13,13 @@
// limitations under the License.
#include "benchmark/reporter.h"
-#include "walltime.h"
+#include "timers.h"
#include <cstdlib>
#include <iostream>
-#include <vector>
#include <tuple>
+#include <vector>
#include "check.h"
#include "stat.h"
@@ -27,49 +27,42 @@
namespace benchmark {
BenchmarkReporter::BenchmarkReporter()
- : output_stream_(&std::cout), error_stream_(&std::cerr)
-{
-}
+ : output_stream_(&std::cout), error_stream_(&std::cerr) {}
-BenchmarkReporter::~BenchmarkReporter() {
-}
+BenchmarkReporter::~BenchmarkReporter() {}
void BenchmarkReporter::PrintBasicContext(std::ostream *out_ptr,
Context const &context) {
CHECK(out_ptr) << "cannot be null";
- auto& Out = *out_ptr;
+ auto &Out = *out_ptr;
Out << "Run on (" << context.num_cpus << " X " << context.mhz_per_cpu
- << " MHz CPU " << ((context.num_cpus > 1) ? "s" : "") << ")\n";
+ << " MHz CPU " << ((context.num_cpus > 1) ? "s" : "") << ")\n";
Out << LocalDateTimeString() << "\n";
if (context.cpu_scaling_enabled) {
Out << "***WARNING*** CPU scaling is enabled, the benchmark "
- "real time measurements may be noisy and will incur extra "
- "overhead.\n";
+ "real time measurements may be noisy and will incur extra "
+ "overhead.\n";
}
#ifndef NDEBUG
Out << "***WARNING*** Library was built as DEBUG. Timings may be "
- "affected.\n";
+ "affected.\n";
#endif
}
double BenchmarkReporter::Run::GetAdjustedRealTime() const {
double new_time = real_accumulated_time * GetTimeUnitMultiplier(time_unit);
- if (iterations != 0)
- new_time /= static_cast<double>(iterations);
+ if (iterations != 0) new_time /= static_cast<double>(iterations);
return new_time;
}
double BenchmarkReporter::Run::GetAdjustedCPUTime() const {
double new_time = cpu_accumulated_time * GetTimeUnitMultiplier(time_unit);
- if (iterations != 0)
- new_time /= static_cast<double>(iterations);
+ if (iterations != 0) new_time /= static_cast<double>(iterations);
return new_time;
}
-
-
-} // end namespace benchmark
+} // end namespace benchmark
OpenPOWER on IntegriCloud