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