diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp index af3d152c9..8f9432e11 100644 --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -9,9 +9,7 @@ #include #include -using namespace benchmark; - -std::map BenchRunner::benchmarks; +std::map 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::iterator it = benchmarks.begin(); + for (std::map::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;