Public Member Functions | Static Public Member Functions

base::Timer Class Reference

A timer class that can be used to get high resolution time values and measure execution times. More...

#include <libppbase/base/Timer.h>

Inheritance diagram for base::Timer:
base::Profiling

List of all members.

Public Member Functions

 Timer ()
 Constructor, resets the timer.
double getMilliSeconds (bool reset=false)
 Returns the number of milliseconds elapsed since the last timer reset.
double getSeconds (bool reset=false)
 Returns the number of seconds elapsed since the last timer reset.
u_longlong_t getTicks (bool reset=false)
 Returns the number of ticks elapsed since the last timer reset.
void reset ()
 Resets the timer.

Static Public Member Functions

static double getMilliSecondsFromTicks (u_longlong_t ticks)
 Converts a ticks value to milliseconds.
static double getSecondsFromTicks (u_longlong_t ticks)
 Converts a ticks value to seconds.
static u_longlong_t getGlobalTicks ()
 Returns the value of the high-resulution time counter.
static void init ()
 Initializes the global timing functions.

Detailed Description

A timer class that can be used to get high resolution time values and measure execution times.

Author:
Christoph Schwarz
Version:
$Id: Timer.h 21 2010-09-05 04:18:17Z cschwarz1 $

Member Function Documentation

static u_longlong_t base::Timer::getGlobalTicks (  )  [static]

Returns the value of the high-resulution time counter.

Returns:
the current value
double base::Timer::getMilliSeconds ( bool  reset = false  ) 

Returns the number of milliseconds elapsed since the last timer reset.

Parameters:
reset flag: reset the timer
Returns:
the number of milliseconds
static double base::Timer::getMilliSecondsFromTicks ( u_longlong_t  ticks  )  [static]

Converts a ticks value to milliseconds.

Parameters:
ticks the ticks value
Returns:
the number of milliseconds this value equals
double base::Timer::getSeconds ( bool  reset = false  ) 

Returns the number of seconds elapsed since the last timer reset.

Parameters:
reset flag: reset the timer
Returns:
the number of seconds
static double base::Timer::getSecondsFromTicks ( u_longlong_t  ticks  )  [static]

Converts a ticks value to seconds.

Parameters:
ticks the ticks value
Returns:
the number of seconds this value equals
u_longlong_t base::Timer::getTicks ( bool  reset = false  ) 

Returns the number of ticks elapsed since the last timer reset.

Parameters:
reset flag: reset the timer
Returns:
the number of ticks
static void base::Timer::init (  )  [static]

Initializes the global timing functions.

This function must be called once for a process, preferably from the main() function.


The documentation for this class was generated from the following file: