39 "looper_sleep_count",
"looper_sleep_time"),
52 , m_was_woken_up (false)
54 , m_start_execution_time ()
55 , m_stats (*Looper_statistics.create_statset ())
56 , m_wait_type (INF_WAITS)
60 std::placeholders::_2);
80 std::placeholders::_2);
84 std::placeholders::_2);
107 std::placeholders::_2);
129 bool is_timed_wait =
true;
145 if (period > execution_time)
147 wait_time = period - execution_time;
173 return m_stop.exchange (
true);
193 is_timed_wait =
true;
202 is_timed_wait =
false;
215 is_timed_wait =
true;
220 is_timed_wait =
false;
void increment(statset &statsetr, stat_id id, stat_value incr=1) const
delta_time m_periods[MAX_LOOPER_PERIODS]
static const cubperf::statset_definition Looper_statistics
void put_to_sleep(waiter &waiter_arg)
static void begin(char *test_name)
void time_and_increment(statset &statsetr, stat_id id, duration d, stat_value incr=1) const
void get_stats(cubperf::stat_value *stats_out)
generic_value< false > stat_value
std::atomic< bool > m_was_woken_up
std::chrono::system_clock::time_point m_start_execution_time
void get_stat_values_with_converted_timers(const statset &statsetr, stat_value *output_stats) const
void setup_infinite_wait(bool &is_timed_wait, delta_time &period)
std::size_t get_value_count() const
clock::time_point time_point
std::atomic< bool > m_stop
std::atomic< std::size_t > m_period_index
static cubperf::stat_id STAT_LOOPER_RESET_COUNT
bool was_woken_up(void) const
cubperf::statset & m_stats
static const char * get_stat_name(std::size_t stat_index)
std::chrono::system_clock::duration delta_time
static const cubperf::stat_id STAT_LOOPER_SLEEP_COUNT_AND_TIME
bool is_stopped(void) const
void setup_increasing_waits(bool &is_timed_wait, delta_time &period)
const char * get_value_name(std::size_t value_index) const
std::function< void(bool &, delta_time &)> period_function
void setup_fixed_waits(bool &is_timed_wait, delta_time &period)
bool wait_for(const std::chrono::system_clock::duration &delta)
period_function m_setup_period
std::size_t m_periods_count
void reset_timept(time_point &timept)
static std::size_t get_stats_value_count(void)