19using Clock = std::chrono::steady_clock;
33 start_ = Clock::now();
48 std::optional<int64_t> window_size_;
49 std::optional<int64_t> nth_samples_report_;
56 const std::optional<int64_t> window_size,
57 const std::optional<int64_t> nth_samples_report);
64#define SCOPED_TIMER(name) timeit::ScopedTimer scoped_timer(name)
70#define SCOPED_TIMER_AVERAGED(name) \
71 static int64_t total_count_; \
72 static timeit::Nanoseconds total_time_; \
73 static timeit::Nanoseconds min_time_ = timeit::Nanoseconds::max(); \
74 timeit::ScopedTimerAveraged scoped_timer( \
75 name, total_count_, total_time_, min_time_, std::nullopt, std::nullopt)
81#define SCOPED_TIMER_AVERAGED_NTH_SAMPLES(name, nth_samples) \
82 static int64_t total_count_; \
83 static timeit::Nanoseconds total_time_; \
84 static timeit::Nanoseconds min_time_ = timeit::Nanoseconds::max(); \
85 timeit::ScopedTimerAveraged scoped_timer( \
86 name, total_count_, total_time_, min_time_, std::nullopt, nth_samples)
92#define SCOPED_TIMER_ROLLING_AVERAGED(name, window_size) \
93 static int64_t total_count_; \
94 static timeit::Nanoseconds total_time_; \
95 static timeit::Nanoseconds min_time_ = timeit::Nanoseconds::max(); \
96 timeit::ScopedTimerAveraged scoped_timer( \
97 name, total_count_, total_time_, min_time_, window_size, std::nullopt)
ScopedTimerAveraged(std::string name, int64_t &total_count, Nanoseconds &total_time, Nanoseconds &min_time, const std::optional< int64_t > window_size, const std::optional< int64_t > nth_samples_report)
ScopedTimer(std::string name)
std::chrono::nanoseconds Nanoseconds
Clock::time_point TimePoint
std::chrono::steady_clock Clock
void print_duration(Nanoseconds duration)