#ifndef __CPRECTIME_H #define __CPRECTIME_H #ifdef _WINDOWS64 #ifdef PUB_TOOLS_EXPORTS #define PUB_TOOLS_API __declspec(dllexport) #else #define PUB_TOOLS_API __declspec(dllimport) #endif #else #define PUB_TOOLS_API #endif #include #include #ifdef _WINDOWS64 #include #else #include #endif using namespace std; class PUB_TOOLS_API CPrecTime { string m_strWork; public: CPrecTime (const string & strWork); ~CPrecTime(); public: int StartTime(); int FinishTime(); /************************************************************ Description:获取计时时间 Input: Output: Input/Output: Others: ************************************************************/ float GetUsedTime(); private: #ifndef _WINDOWS64 struct timeval m_TpStart, m_TpFinish; struct timezone m_TzpStart, m_TzpFinish; #else int m_StartMSec; int m_EndMSec; #endif }; #endif