#ifndef OB_TIMER_HH #define OB_TIMER_HH #include #include #include #include namespace OB { class Timer { public: Timer() { } ~Timer() { } void start() { _start = std::chrono::high_resolution_clock::now(); } void stop() { _stop = std::chrono::high_resolution_clock::now(); } template long int time() { return std::chrono::duration_cast(_stop - _start).count(); } long int time() { return std::chrono::duration_cast(_stop - _start).count(); } private: std::chrono::time_point _start; std::chrono::time_point _stop; }; // class Timer } // namespace OB #endif // OB_TIMER_HH