#include <string>
#include <benchmark/benchmark.h>
#include "farmhash.h"

static void BM_Farmhash(benchmark::State& state) {
  auto payload = std::string(state.range(0), '.');
  while (state.KeepRunning())
    util::Hash64(payload);
  state.SetBytesProcessed(int64_t(state.iterations()) * int64_t(state.range(0)));
}

// Register the function as a benchmark
BENCHMARK(BM_Farmhash)->Arg(4)->Arg(11)->Arg(25)->Arg(100)->Arg(1000)->Arg(10000);

BENCHMARK_MAIN();

#include <string>
#include <benchmark/benchmark.h>
#include "farmhash.h"

static void BM_Farmhash(benchmark::State& state) {
  auto payload = std::string(state.range(0), '.');
  for (auto _ : state)
    util::Hash64(payload);
  state.SetBytesProcessed(int64_t(state.iterations()) * int64_t(state.range(0)));
}

// Register the function as a benchmark
BENCHMARK(BM_Farmhash)->Arg(4)->Arg(11)->Arg(25)->Arg(100)->Arg(1000)->Arg(10000);

BENCHMARK_MAIN();

Use recommended c++11 benchmark loop
Use recommended c++11 benchmark loop
