timer.h

来自「USB VC测试程序 周立功的USB板调试源码」· C头文件 代码 · 共 20 行

H
20
字号
#if !defined _TIMER_H
#define _TIMER_H

class CTIMER  {
public:
	inline CTIMER()	{ memset(this, 0, sizeof(*this));}
	inline void Start()  { QueryPerformanceCounter(&m_sStart); }
	inline void Stop()   { QueryPerformanceCounter(&m_sStop); }
	inline double OutputTime()
	{ 
		QueryPerformanceFrequency(&m_liFreq);
		__int64 i,j;
		i=m_sStop.LowPart+((__int64)m_sStop.HighPart<<32);
		j=m_sStart.LowPart+((__int64)m_sStart.HighPart<<32);
		return (double)(( i - j )/(double)m_liFreq.LowPart);
	}     // data members     
	LARGE_INTEGER m_sStart, m_sStop, m_liFreq;
}; 

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?