#include "timer.h" #include Timer::Timer() { Reset(); } void Timer::Reset() { start = Clock::now(); } void Timer::ResetAndPrint(const std::string& message) { std::cerr << message << " took " << ElapsedMilliseconds() << "ms" << std::endl; Reset(); } long long Timer::ElapsedMilliseconds() { std::chrono::time_point end = Clock::now(); return std::chrono::duration_cast(end - start).count(); }