/* Execution timer class. */ class ExecuteTimer { public: ExecuteTimer(); ~ExecuteTimer(); /*\brief: Get char* type time. *\return: char* type time, unit:second. */ char* GetCTime(); /*\brief: Get double type time. *\return: double type time, unit:second. */ double GetDTime(); /*\brief: Reset the begin time. */ void Reset(); /*\brief: ostream << operator friend function. *\param: os, The left operation. *\param: obj, The right operation. *\return: std::ostream object ref.. */ friend std::ostream& operator << (std::ostream& os, ExecuteTimer& obj); /*\brief: ofstream << operator friend function. *\param: os, The left operation. *\param: obj, The right operation. *\return: std::ofstream object ref.. */ friend std::ofstream& operator << (std::ofstream& ofs, ExecuteTimer& obj); private: struct timespec m_begin; char m_ctime[32]; };