#include "timer.h" #include #include Timer::Timer(std::string_view name) : name_(name) { start(); }; void Timer::start() { start_ = std::chrono::high_resolution_clock::now(); } void Timer::stop() { auto end = std::chrono::high_resolution_clock::now(); auto duration = std::chrono::duration_cast(end - start_); std::cout << name_ << " took " << duration << std::endl; }