blob: 4fa7ec0bf9d3cd14fe0e3a9153bdcbc1bfc91d67 [file] [log] [blame]
#include "benchmark/benchmark.h"
void BM_StringCreation(benchmark::State& state) {
while (state.KeepRunning())
std::string empty_string;
}
BENCHMARK(BM_StringCreation);
void BM_StringCopy(benchmark::State& state) {
std::string x = "hello";
while (state.KeepRunning())
std::string copy(x);
}
BENCHMARK(BM_StringCopy);
BENCHMARK_MAIN();