diff options
author | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2016-12-05 16:03:53 +0900 |
---|---|---|
committer | Kalle Alm <kalle.alm@gmail.com> | 2017-01-02 20:35:23 +0900 |
commit | 73f41190b91dce9c125b1828b18f7625e0200145 (patch) | |
tree | 7fbc5af2fa822231182c85df8d5d9826e8c1ecae /src/bench/bench.cpp | |
parent | 53442af0aac3838179fad79a65512ee8c5603922 (diff) |
Refactoring: Removed using namespace <xxx> from bench/ and test/ source files.
Diffstat (limited to 'src/bench/bench.cpp')
-rw-r--r-- | src/bench/bench.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp index af3d152c9a..8f9432e11c 100644 --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -9,9 +9,7 @@ #include <iomanip> #include <sys/time.h> -using namespace benchmark; - -std::map<std::string, BenchFunction> BenchRunner::benchmarks; +std::map<std::string, benchmark::BenchFunction> benchmark::BenchRunner::benchmarks; static double gettimedouble(void) { struct timeval tv; @@ -19,29 +17,29 @@ static double gettimedouble(void) { return tv.tv_usec * 0.000001 + tv.tv_sec; } -BenchRunner::BenchRunner(std::string name, BenchFunction func) +benchmark::BenchRunner::BenchRunner(std::string name, benchmark::BenchFunction func) { benchmarks.insert(std::make_pair(name, func)); } void -BenchRunner::RunAll(double elapsedTimeForOne) +benchmark::BenchRunner::RunAll(double elapsedTimeForOne) { perf_init(); std::cout << "#Benchmark" << "," << "count" << "," << "min" << "," << "max" << "," << "average" << "," << "min_cycles" << "," << "max_cycles" << "," << "average_cycles" << "\n"; - for (std::map<std::string,BenchFunction>::iterator it = benchmarks.begin(); + for (std::map<std::string,benchmark::BenchFunction>::iterator it = benchmarks.begin(); it != benchmarks.end(); ++it) { State state(it->first, elapsedTimeForOne); - BenchFunction& func = it->second; + benchmark::BenchFunction& func = it->second; func(state); } perf_fini(); } -bool State::KeepRunning() +bool benchmark::State::KeepRunning() { if (count & countMask) { ++count; |