- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exponent::Testing::CPrecisionTimer Class Reference

List of all members.

## Detailed Description

Provides a high accuracy timer for measuring process block CPU usage.

Date:
  14/10/2005

Author:
  Paul Chana

Version:
  1.0.0 Initial version

Note:
  All contents of this source code are copyright 2005 Exp Digital Uk.
  This source file is covered by the licence conditions of the Infinity API. You should have recieved a copy
  with the source code. If you didnt, please refer to http://www.expdigital.co.uk All content is the Intellectual property of Exp Digital Uk.
  Certain sections of this code may come from other sources. They are credited where applicable.
  If you have comments, suggestions or bug reports please visit http://support.expdigital.co.uk

Id
  CPrecisionTimer.hpp,v 1.2 2007/02/08 21:06:44 paul Exp

Definition at line 27 of file CPrecisionTimer.hpp.

## Public Member Functions

- CPrecisionTimer ()
- double getCPUUsage (const long numberOfSamples)
- double getProcessorTime ()
- void setSampleRate (const double sampleRate)
- void startTimer ()
- virtual ~CPrecisionTimer ()

## Static Public Member Functions

- static void initialise ()

## Protected Attributes

- uint64 m_counter
- double m_sampleRate

## Static Protected Attributes

- static bool CPRECISION_TIMER_INITIALISED
- static double CPRECISION_TIMER_INV_FREQUENCY

## Constructor & Destructor Documentation

Exponent::Testing::CPrecisionTimer::CPrecisionTimer | ( |  | ) |

Construction

virtual Exponent::Testing::CPrecisionTimer::~CPrecisionTimer | ( |  | ) | `[virtual]`

Destruction

## Member Function Documentation

double Exponent::Testing::CPrecisionTimer::getCPUUsage | ( | const long | numberOfSamples | ) |

Get the % of CPU being used by a function

Parameters:

  | numberOfSamples | The number of samples processed

Return values:

  | double | The % of CPU being used (0 : 1)

double Exponent::Testing::CPrecisionTimer::getProcessorTime | ( |  | ) |

Get the elapsed time since timer started in seconds

Return values:

  | double | The elapsed time in seconds

static void Exponent::Testing::CPrecisionTimer::initialise | ( |  | ) | `[static]`

Intialise - Call this once per aplication instance

void Exponent::Testing::CPrecisionTimer::setSampleRate | ( | const double | sampleRate | ) | `[inline]`

Set the sample rate of the system

Parameters:

  | sampleRate | the samplerate to use

Definition at line 64 of file CPrecisionTimer.hpp.

References m_sampleRate.

void Exponent::Testing::CPrecisionTimer::startTimer | ( |  | ) |

Call this to start timing at the beginning of your process block

## Member Data Documentation

bool Exponent::Testing::CPrecisionTimer::CPRECISION_TIMER_INITIALISED`[static, protected]`

Are we initialised

Definition at line 77 of file CPrecisionTimer.hpp.

double Exponent::Testing::CPrecisionTimer::CPRECISION_TIMER_INV_FREQUENCY`[static, protected]`

Sampling frequency

Definition at line 78 of file CPrecisionTimer.hpp.

uint64 Exponent::Testing::CPrecisionTimer::m_counter`[protected]`

Timer count

Definition at line 82 of file CPrecisionTimer.hpp.

double Exponent::Testing::CPrecisionTimer::m_sampleRate`[protected]`

Samplerate of the signal

Definition at line 83 of file CPrecisionTimer.hpp.

Referenced by setSampleRate().