codes/google/benchmark/benchmark07/main.cpp
static void BM_SetInsert(benchmark::State& state) {
  std::set<int> data;
  for (auto _ : state) {
    state.PauseTiming();
    ConstructRandomSet(state.range(0), data );
    state.ResumeTiming();
    for (int j = 0; j < state.range(1); ++j)
      data.insert(random(0, state.range(1)));
  }
}
// You might have a microbenchmark that depends on two inputs.  For
// example, the following code defines a family of microbenchmarks for
// measuring the speed of set insertion.
You might have a microbenchmark that depends on two inputs.  For
example, the following code defines a family of microbenchmarks for
measuring the speed of set insertion.
You might have a microbenchmark that depends on two inputs . For example the following code defines a family of microbenchmarks for measuring the speed of set insertion .
static void BM_SetInsert(benchmark::State& state) {
  std::set<int> data;
  for (auto _ : state) {
    state.PauseTiming();
    ConstructRandomSet(state.range(0), data );
    state.ResumeTiming();
    for (int j = 0; j < state.range(1); ++j)
      data.insert(random(0, state.range(1)));
  }
}
static void BM_SetInsert ( benchmark :: State & state ) { std :: set < int > data ; for ( auto _ : state ) { state . PauseTiming ( ) ; ConstructRandomSet ( state . range ( 0 ) , data ) ; state . ResumeTiming ( ) ; for ( int j = 0 ; j < state . range ( 1 ) ; ++ j ) data . insert ( random ( 0 , state . range ( 1 ) ) ) ; } }
You might have a microbenchmark that depends on two inputs.
You might have a microbenchmark that depends on two inputs .