13 using Clock = std::chrono::steady_clock;
27 start_ = Clock::now();
35 std::cout <<
"Timer '" << name_ <<
"' took ";
55 : name_(
std::move(name)),
56 total_count_(total_count),
57 total_time_(total_time),
60 start_ = Clock::now();
68 #define SCOPED_TIMER(name) blender::timeit::ScopedTimer scoped_timer(name)
74 #define SCOPED_TIMER_AVERAGED(name) \
75 static int64_t total_count_; \
76 static blender::timeit::Nanoseconds total_time_; \
77 static blender::timeit::Nanoseconds min_time_ = blender::timeit::Nanoseconds::max(); \
78 blender::timeit::ScopedTimerAveraged scoped_timer(name, total_count_, total_time_, min_time_)
ScopedTimerAveraged(std::string name, int64_t &total_count, Nanoseconds &total_time, Nanoseconds &min_time)
ScopedTimer(std::string name)
Clock::time_point TimePoint
void print_duration(Nanoseconds duration)
std::chrono::nanoseconds Nanoseconds
std::chrono::steady_clock Clock