//---------------------------------------------------------------------------- // Laser Guard Ltd. // Copyright © 2000-2002. All Rights Reserved. // Version 1.0 01/01/2000 // Last modification: 09/07/2001 // PROJECT: // SUBSYSTEM: // FILE: PerformanceCounter.cpp // AUTHOR: Sergey Chizhevskiy // OVERVIEW // ~~~~~~~~ // Source file of PerformanceCounter.cpp //---------------------------------------------------------------------------- #include "stdafx.h" #include "PerformanceCounter.h" #include CPerformanceCounter::CPerformanceCounter() { ::QueryPerformanceFrequency( &m_liFrequency ); } CPerformanceCounter::~CPerformanceCounter() { } void CPerformanceCounter::Begin() { ::QueryPerformanceCounter( &m_liCounter ); } double CPerformanceCounter::End() { LARGE_INTEGER li; ::QueryPerformanceCounter( &li ); double r = (double)(li.QuadPart - m_liCounter.QuadPart) / (double) m_liFrequency.QuadPart; #ifdef _DEBUG char pText[10]; sprintf( pText, "%0.9f\n", r ); OutputDebugString( pText ); #endif return r; }