Download Source Code

CHqTimer Class Reference

Timer class using high accuracy hardware timer if available. More...

#include <HqTimer.h>

List of all members.

Public Member Functions

 CHqTimer ()
 Default Constructor.
virtual ~CHqTimer ()
 Destructor.
BOOL IsReset ()
 Returns non-zero if timer is reset.
BOOL IsRunning ()
 Returns non-zero if timer is running.
BOOL IsStopped ()
 Returns non-zero if timer is stopped.
void Reset ()
 Resets internal values.
LONGLONG Start ()
 Saves the current time as start time.
LONGLONG Start (LONGLONG ll)
 Saves the specified time as start time.
LONGLONG Stop ()
 Saves the current time as stop time.
LONGLONG Stop (LONGLONG ll)
 Saves the specified time as stop time.
LONGLONG Ellapsed ()
 Returns amount of time captured or ellapsed since.
double EllapsedSeconds ()
 Returns ellapsed time in seconds.

Static Public Member Functions

static LONGLONG GetTimerFrequency ()
 Returns the frequency of the active timer.
static LONGLONG GetTimer ()
 Return the current timer value.


Detailed Description

Timer class using high accuracy hardware timer if available.

This class attempts to use the high accuracy hardware timer via the Windows API QueryPerformanceCounter() function if available. If this counter is not available, it falls back on the less reliable GetTickCount() value.


Member Function Documentation

LONGLONG CHqTimer::Start LONGLONG  ll  )  [inline]
 

Saves the specified time as start time.

Parameters:
[in] ll - Start time

LONGLONG CHqTimer::Stop LONGLONG  ll  )  [inline]
 

Saves the specified time as stop time.

Parameters:
[in] ll - Stop time


The documentation for this class was generated from the following files:
  • inc/HqTimer.h
  • HqTimer.cpp
Copyright Robert Umbehant
This documentation is covered by the LGPL