: QICounter


class QICounter
{
public:
	LARGE_INTEGER _Frequency;
	LARGE_INTEGER _Start;
	LARGE_INTEGER _End;
	QICounter()
	{
		QueryPerformanceFrequency(&_Frequency);
	}

	DWORD Start()
	{
		QueryPerformanceCounter(&_Start);
		return 0;
	}

	DWORD CountMS()
	{
		QueryPerformanceCounter(&_End);
		DWORD dwTime = (DWORD)((_End.QuadPart - _Start.QuadPart) * 1000.0 / _Frequency.QuadPart);
		return dwTime;
	}

	DWORD CountNS()
	{
		QueryPerformanceCounter(&_End);
		DWORD dwTime = (DWORD)((_End.QuadPart - _Start.QuadPart) * 1000.0 * 1000.0 / _Frequency.QuadPart);
		return dwTime;
	}


};

Leave a Reply

メールアドレスが公開されることはありません。

注意(NOTICE)

コメントの投稿は反映までに時間がかかる場合があります。 Post Comments may take some minutes to publish.