14#ifndef BOOST_FAIRNESS_WAITING_UTILS_HPP
15#define BOOST_FAIRNESS_WAITING_UTILS_HPP
18#define NOW std::chrono::high_resolution_clock::now()
27 template <WaitingLevel level>
32 for(;std::chrono::duration_cast<std::chrono::milliseconds>(
NOW - begin).count() < utime;){
33 benchmark::DoNotOptimize(i += 1);
36 for(;std::chrono::duration_cast<std::chrono::microseconds>(
NOW - begin).count() < utime;){
37 benchmark::DoNotOptimize(i += 1);
40 for(;std::chrono::duration_cast<std::chrono::nanoseconds>(
NOW - begin).count() < utime;){
41 benchmark::DoNotOptimize(i += 1);
47 busy_wait<WaitingLevel::Milli>(50);
53 busy_wait<WaitingLevel::Micro>(50);
59 busy_wait<WaitingLevel::Nano>(50);
Definition waiting_utils.hpp:20
void busy_wait_50micro_benchmark(benchmark::State &state)
Definition waiting_utils.hpp:51
void busy_wait_50nano_benchmark(benchmark::State &state)
Definition waiting_utils.hpp:57
void busy_wait(uint32_t utime)
Definition waiting_utils.hpp:28
void busy_wait_50milli_benchmark(benchmark::State &state)
Definition waiting_utils.hpp:45
WaitingLevel
Definition waiting_utils.hpp:21
#define NOW
Definition thread_utils.hpp:20