File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
examples/google_benchmark_cmake Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 55#include < chrono>
66#include < thread>
77
8- static void BM_sleep_1ns (benchmark::State& state) {
8+ static void BM_sleep_1us (benchmark::State& state) {
99 for (auto _ : state) {
10- std::this_thread::sleep_for (std::chrono::nanoseconds (1 ));
10+ std::this_thread::sleep_for (std::chrono::microseconds (1 ));
1111 }
1212}
13- BENCHMARK (BM_sleep_1ns );
13+ BENCHMARK (BM_sleep_1us );
1414
15- static void BM_sleep_100ns (benchmark::State& state) {
15+ static void BM_sleep_10us (benchmark::State& state) {
1616 for (auto _ : state) {
17- std::this_thread::sleep_for (std::chrono::nanoseconds ( 100 ));
17+ std::this_thread::sleep_for (std::chrono::microseconds ( 10 ));
1818 }
1919}
20- BENCHMARK (BM_sleep_100ns );
20+ BENCHMARK (BM_sleep_10us );
2121
22- static void BM_sleep_1us (benchmark::State& state) {
22+ static void BM_sleep_50us (benchmark::State& state) {
2323 for (auto _ : state) {
24- std::this_thread::sleep_for (std::chrono::microseconds (1 ));
24+ std::this_thread::sleep_for (std::chrono::microseconds (50 ));
2525 }
2626}
27- BENCHMARK (BM_sleep_1us );
27+ BENCHMARK (BM_sleep_50us );
2828
2929static void BM_sleep_100us (benchmark::State& state) {
3030 for (auto _ : state) {
You can’t perform that action at this time.
0 commit comments