use benchmark definitions as suggested by docs
diff --git a/bench/run.cpp b/bench/run.cpp index ab61b6b..c88034c 100644 --- a/bench/run.cpp +++ b/bench/run.cpp
@@ -4,7 +4,7 @@ #include "../examples/utils.hpp" namespace { - void BM_simple(benchmark::State& state) + void BM_45K_geojson_nodes(benchmark::State& state) { std::string points_str = utils::read_file("./test/test-files/osm-nodes-45331-epsg-3857.geojson"); std::vector<double> coords = utils::get_geo_json_points(points_str); @@ -16,11 +16,6 @@ } } -int main(int argc, char* argv[]) -{ - benchmark::RegisterBenchmark("BM_simple", BM_simple); - benchmark::Initialize(&argc, argv); - benchmark::RunSpecifiedBenchmarks(); +BENCHMARK(BM_45K_geojson_nodes)->Unit(benchmark::kMillisecond); - return 0; -} +BENCHMARK_MAIN();