#pragma once #include namespace utils { // This class is threadsafe. class Timer { public: /** Time elapsed since creation. */ std::chrono::duration Elapsed() const { return std::chrono::steady_clock::now() - start_time_; } private: std::chrono::time_point start_time_ = std::chrono::steady_clock::now(); }; };