#pragma once #include #include namespace vcpkg { class ElapsedTime { public: static ElapsedTime createStarted(); constexpr ElapsedTime() : m_startTick() {} template TimeUnit elapsed() const { return std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - this->m_startTick); } double microseconds() const { return elapsed>().count(); } std::string toString() const; private: std::chrono::high_resolution_clock::time_point m_startTick; }; }