blob: 4fa7ec0bf9d3cd14fe0e3a9153bdcbc1bfc91d67 [file] [log] [blame]
Austin Schuhcbc17402019-01-21 21:00:30 -08001#include "benchmark/benchmark.h"
2
3void BM_StringCreation(benchmark::State& state) {
4 while (state.KeepRunning())
5 std::string empty_string;
6}
7
8BENCHMARK(BM_StringCreation);
9
10void BM_StringCopy(benchmark::State& state) {
11 std::string x = "hello";
12 while (state.KeepRunning())
13 std::string copy(x);
14}
15
16BENCHMARK(BM_StringCopy);
17
18BENCHMARK_MAIN();