#include <iostream>
#include <windows.h>

class TimeCal
{
private:
	_LARGE_INTEGER m_time_start;    /*开始时间*/
	_LARGE_INTEGER m_time_over;     /*结束时间*/
	double m_dqFreq;                /*计时器频率*/

public:
	void Init()
	{
		LARGE_INTEGER f;
		QueryPerformanceFrequency(&f);
		m_dqFreq=(double)f.QuadPart;
	}

	void Start()
	{
		QueryPerformanceCounter(&m_time_start);
	}
	void End()
	{
		QueryPerformanceCounter(&m_time_over);
	}
	double GetTime()
	{
		return (m_time_over.QuadPart-m_time_start.QuadPart)/m_dqFreq;
	}
};