SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
SeComLib::Utils::CpuTimer Class Reference

Utilitary class providing algorithm timing functionality. More...

#include <cpu_timer.h>

Public Types

typedef
boost::timer::nanosecond_type 
NanosecondType
 Nanosecond data type (int_least64_t)
 

Public Member Functions

 CpuTimer ()
 Default constructor. More...
 
 ~CpuTimer ()
 Destructor - void implementation.
 
void Stop ()
 Stops the timer.
 
void Reset ()
 Resets the timer.
 
NanosecondType GetDuration () const
 Returns the elapsed user process time (in nanoseconds) More...
 
std::string ToString () const
 Returns the elapsed user process time as a formatted string (HH::MM::SS.mmm) More...
 

Static Public Member Functions

static std::string ToString (CpuTimer::NanosecondType userTime)
 Returns the elapsed user process time as a formatted string (HH::MM::SS.mmm) More...
 

Private Member Functions

 CpuTimer (CpuTimer const &)
 Copy constructor - not implemented.
 
CpuTimer operator= (CpuTimer const &)
 Copy assignment operator - not implemented.
 

Private Attributes

boost::timer::cpu_timer timer
 the internal timer variable
 

Detailed Description

Utilitary class providing algorithm timing functionality.

Definition at line 47 of file cpu_timer.h.

Constructor & Destructor Documentation

SeComLib::Utils::CpuTimer::CpuTimer ( )

Default constructor.

Initialize and start the timer

Definition at line 37 of file cpu_timer.cpp.

Member Function Documentation

CpuTimer::NanosecondType SeComLib::Utils::CpuTimer::GetDuration ( ) const

Returns the elapsed user process time (in nanoseconds)

Returns
The elapsed user process time (in nanoseconds)

Definition at line 56 of file cpu_timer.cpp.

std::string SeComLib::Utils::CpuTimer::ToString ( ) const

Returns the elapsed user process time as a formatted string (HH::MM::SS.mmm)

Returns
Formatted string of the elapsed user process time (HH::MM::SS.mmm)

Definition at line 63 of file cpu_timer.cpp.

std::string SeComLib::Utils::CpuTimer::ToString ( CpuTimer::NanosecondType  userTime)
static

Returns the elapsed user process time as a formatted string (HH::MM::SS.mmm)

Parameters
userTimea time duration expressed in nanoseconds
Returns
a string containing the formatted user time

Format the output string

Definition at line 71 of file cpu_timer.cpp.


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