墨·联。书写笔记,用墨迹连接你我。
#include <iostream> #include <chrono> #include <thread> class Timer { public: Timer() : start_time(std::chrono::high_resolution_clock::now()) {} void reset() { start_time = std::chrono::high_resolution_clock::now(); } double elapsed() const { auto now = std::chrono::high_resolution_clock::now(); auto duration = std::chrono::duration_cast<std::chrono::microseconds>(now - start_time); return duration.count() * 1e-6; // 将微秒转
墨联
墨·联墨迹笔记,用书写连接你我