aboutsummaryrefslogtreecommitdiff
path: root/conan/test_package/test_package.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'conan/test_package/test_package.cpp')
-rw-r--r--conan/test_package/test_package.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/conan/test_package/test_package.cpp b/conan/test_package/test_package.cpp
new file mode 100644
index 0000000..4fa7ec0
--- /dev/null
+++ b/conan/test_package/test_package.cpp
@@ -0,0 +1,18 @@
+#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();