Click here to Skip to main content
Click here to Skip to main content

Introduction to MMX Programming

By , 8 Jul 2003
 
// TimeCounterEx.h


#ifndef TIME_COUNTER_H
#define TIME_COUNTER_H

#pragma warning( disable : 4710 )

// Helper class used to show execution time
class CTimeCounter
{
public:
    CTimeCounter()
    {
        QueryPerformanceFrequency(&m_nFreq);
        QueryPerformanceCounter(&m_nBeginTime);
    }

    __int64 GetExecutionTime()
    {
            LARGE_INTEGER nEndTime;
            __int64 nCalcTime;

        	QueryPerformanceCounter(&nEndTime);
            nCalcTime = (nEndTime.QuadPart - m_nBeginTime.QuadPart) *
                1000/m_nFreq.QuadPart;

            delete this;

            return nCalcTime;
    }

    ~CTimeCounter()
    {
    }


protected:
    LARGE_INTEGER m_nFreq;
    LARGE_INTEGER m_nBeginTime;

};



#endif

By viewing downloads associated with this article you agree to the Terms of use and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Alex Fr
Software Developer
Israel Israel
Member
No Biography provided

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 9 Jul 2003
Article Copyright 2003 by Alex Fr
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid