Build: update docker build scripts
[marnav.git] / test / nmea / Benchmark_nmea_manufacturer.cpp
blobe53dfe37d8a86799c52fa9b00e1f6bd096f35a02
1 #include <benchmark/benchmark.h>
2 #include <marnav/nmea/manufacturer.hpp>
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()