#ifndef __UTILS__ #define __UTILS__ #include #include namespace utils{ class hdTimer{ public: hdTimer(){ } void tik(){ start = std::chrono::high_resolution_clock::now(); } void tok(){ end = std::chrono::high_resolution_clock::now(); } double cost(){ return double( std::chrono::duration_cast(end-start).count())/1000000000.0; } private: std::chrono::time_point start,end; }; } #endif