23 #ifndef _PERF_DEF_HPP_ 24 #define _PERF_DEF_HPP_ 39 using clock = std::chrono::high_resolution_clock;
44 template <
bool IsAtomic>
45 using generic_value =
typename std::conditional<IsAtomic, std::atomic<std::uint64_t>, std::uint64_t>::type;
53 template<
bool IsAtomic>
78 template <
bool IsAtomic>
86 const char *get_name (
void);
95 template <
bool IsAtomic>
102 inline void time (
void);
104 const char *get_name (
void);
115 template <
bool IsAtomic>
124 inline void time_and_increment (
stat_value incr = 1);
128 const char *get_count_name (
void);
129 const char *get_time_name (
void);
146 #endif // _PERF_DEF_HPP_ generic_value< IsAtomic > m_stat_value
generic_value< false > stat_value
typename std::conditional< IsAtomic, std::atomic< std::uint64_t >, std::uint64_t >::type generic_value
std::size_t m_value_count
generic_value< true > atomic_stat_value
generic_statset(void)=delete
clock::time_point time_point
std::chrono::high_resolution_clock clock
static void get_time(struct timeval *start_time, char *time, int buf_len)
generic_value< IsAtomic > * m_values
generic_stat_timer< IsAtomic > m_stat_timer
generic_stat_counter< IsAtomic > m_stat_counter
generic_value< IsAtomic > m_stat_value