The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CPerformanceCounter Class Reference

Collaboration diagram for CPerformanceCounter:

List of all members.


Detailed Description

A class that wraps the QueryPerformanceCounter() API for high performance timing of sections of code.


Public Types

enum  ThreadAffinity { NoThreadAffinity, LockThreadToOneCPU }

Public Member Functions

 CPerformanceCounter (ThreadAffinity threadAffinity=NoThreadAffinity)
 Constructs a timer with the specified thread affinity and starts it.
 CPerformanceCounter (const CPerformanceCounter &rhs)
CPerformanceCounteroperator= (const CPerformanceCounter &rhs)
LARGE_INTEGER GetRawCounter () const
LARGE_INTEGER GetCounter () const
LARGE_INTEGER GetFrequency () const
Milliseconds GetCounterMilliseconds () const
void Reset ()
 Resets a counter.
DWORD GetElapsedTimeAsDWORD () const
 Gets the elapsed time since the counter was either constructed or reset.
LARGE_INTEGER GetElapsedTime () const
 Gets the elapsed time since the counter was either constructed or reset.
_tstring GetElapsedTimeAsString () const
 Gets the elapsed time since the counter was either constructed or reset.


Member Enumeration Documentation

Enumerator:
NoThreadAffinity 
LockThreadToOneCPU 


Constructor & Destructor Documentation

CPerformanceCounter ( ThreadAffinity  threadAffinity = NoThreadAffinity  )  [explicit]

Constructs a timer with the specified thread affinity and starts it.


Member Function Documentation

CPerformanceCounter& operator= ( const CPerformanceCounter rhs  ) 

LARGE_INTEGER GetRawCounter (  )  const

LARGE_INTEGER GetCounter (  )  const

LARGE_INTEGER GetFrequency (  )  const

Milliseconds GetCounterMilliseconds (  )  const

void Reset (  ) 

Resets a counter.

DWORD GetElapsedTimeAsDWORD (  )  const

Gets the elapsed time since the counter was either constructed or reset.

LARGE_INTEGER GetElapsedTime (  )  const

Gets the elapsed time since the counter was either constructed or reset.

_tstring GetElapsedTimeAsString (  )  const

Gets the elapsed time since the counter was either constructed or reset.


Generated on Sun Sep 12 19:09:03 2021 for The Server Framework - v7.4 by doxygen 1.5.3