목록Chrono (2)
일상 코딩
1. main.cpp #include "Worker.h" // using namespace std; int main() { Worker().doSomething(); return 0; } 2. Timer.h #pragma once #include #include #include #include #include class Timer { private: using clock_t = std::chrono::high_resolution_clock; using second_t = std::chrono::duration; std::chrono::time_point start_time = clock_t::now(); public: void elapsed() { std::chrono::time_point end_tim..
출처 https://gist.github.com/mcleary/b0bf4fa88830ff7c882d C++ Timer using std::chrono C++ Timer using std::chrono. GitHub Gist: instantly share code, notes, and snippets. gist.github.com #include #include #include #include class Timer { public: void start() { m_StartTime = std::chrono::system_clock::now(); m_bRunning = true; } void stop() { m_EndTime = std::chrono::system_clock::now(); m_bRunning ..