home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 1.7 KB | 79 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWPrfCnt.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWPRFCNT_H
- #define FWPRFCNT_H
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifdef FW_PROFILE
-
- #if defined(FW_BUILD_MAC) && !defined(__TIMER__)
- #include <Timer.h>
- #endif
-
- #if defined(FW_BUILD_WIN) && !defined(_INC_WINDOWS)
- #include <windows.h>
- #endif
-
- //========================================================================================
- // CLASS FW_CPrivPerformanceCounter
- //========================================================================================
-
- class FW_CPrivPerformanceCounter
- {
- public:
- // ---- Construction
- FW_CPrivPerformanceCounter();
- ~FW_CPrivPerformanceCounter();
-
- void EndCheckPoint();
-
- // ----- Implementation
- private:
- long fResult;
- #ifdef FW_BUILD_WIN
- LARGE_INTEGER fWinBegin;
- LARGE_INTEGER fWinEnd;
- static DWORD gWinOverhead;
- static DWORD gWinFreq;
- #endif
- #ifdef FW_BUILD_MAC
- TMTask fMacTMTask;
- FW_Boolean fMacIsInQueue;
-
- static long gMacTMOverhead;
- #endif
- };
-
- #endif
-
- //========================================================================================
- // Performance counter macros
- //========================================================================================
-
- #ifdef FW_PROFILE
-
- #define FW_PERF_CNT_BEGIN(name) \
- FW_CPrivPerformanceCounter perfCntObj##name;
-
- #define FW_PERF_CNT_END(name) \
- perfCntObj##name.EndCheckPoint();
-
- #else
-
- #define FW_PERF_CNT_BEGIN(name) ((void) 0)
- #define FW_PERF_CNT_END(name) ((void) 0)
-
- #endif
-
- #endif // FWPRFCNT_H
-