NMEA: make nmeatool available with/without ENABLE_IO
[marnav.git] / test / nmea / Benchmark_nmea_manufacturer.cpp
blobb4f1da4f3edbbd6c5f43779526e4acedc19a3364
1 #include <marnav/nmea/manufacturer.hpp>
2 #include <benchmark/benchmark.h>
4 static void benchmark_get_manufacturer_name_from_id(benchmark::State & state)
6 using namespace marnav;
8 const std::vector<nmea::manufacturer_id> ids = nmea::get_supported_manufacturer_id();
10 while (state.KeepRunning()) {
11 for (auto id : ids) {
12 std::string name = nmea::get_manufacturer_name(id);
13 benchmark::DoNotOptimize(name);
18 BENCHMARK(benchmark_get_manufacturer_name_from_id);
20 static void benchmark_get_supported_manufacturer_id(benchmark::State & state)
22 using namespace marnav;
24 while (state.KeepRunning()) {
25 const std::vector<nmea::manufacturer_id> ids = nmea::get_supported_manufacturer_id();
26 benchmark::DoNotOptimize(ids);
30 BENCHMARK(benchmark_get_supported_manufacturer_id);
32 BENCHMARK_MAIN();