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 5
5
#include < chrono>
6
6
#include < thread>
7
7
8
- static void BM_sleep_1ns (benchmark::State& state) {
8
+ static void BM_sleep_1us (benchmark::State& state) {
9
9
for (auto _ : state) {
10
- std::this_thread::sleep_for (std::chrono::nanoseconds (1 ));
10
+ std::this_thread::sleep_for (std::chrono::microseconds (1 ));
11
11
}
12
12
}
13
- BENCHMARK (BM_sleep_1ns );
13
+ BENCHMARK (BM_sleep_1us );
14
14
15
- static void BM_sleep_100ns (benchmark::State& state) {
15
+ static void BM_sleep_10us (benchmark::State& state) {
16
16
for (auto _ : state) {
17
- std::this_thread::sleep_for (std::chrono::nanoseconds ( 100 ));
17
+ std::this_thread::sleep_for (std::chrono::microseconds ( 10 ));
18
18
}
19
19
}
20
- BENCHMARK (BM_sleep_100ns );
20
+ BENCHMARK (BM_sleep_10us );
21
21
22
- static void BM_sleep_1us (benchmark::State& state) {
22
+ static void BM_sleep_50us (benchmark::State& state) {
23
23
for (auto _ : state) {
24
- std::this_thread::sleep_for (std::chrono::microseconds (1 ));
24
+ std::this_thread::sleep_for (std::chrono::microseconds (50 ));
25
25
}
26
26
}
27
- BENCHMARK (BM_sleep_1us );
27
+ BENCHMARK (BM_sleep_50us );
28
28
29
29
static void BM_sleep_100us (benchmark::State& state) {
30
30
for (auto _ : state) {
You can’t perform that action at this time.
0 commit comments