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()) {
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
);