ContRap-Core
Public Types | Public Member Functions

crp::Timer Class Reference

Timer is a platform independent timer class. More...

#include <timer.h>

Public Types

enum  Clock { VIRTUAL, SYSTEM }
 

Enumerates the different clock types.

More...

Public Member Functions

 Timer (Clock clock_type=SYSTEM)
 Creates a new timer.
 ~Timer ()
 Destructor does nothing.
void start ()
 Starts measuring time.
void stop ()
 Stops measuring time.
double elapsed ()
 Returns the measured time in milliseconds (not neccessary integer)
bool is_running ()
 Checks if the timer is started.

Detailed Description

Timer is a platform independent timer class.


Member Enumeration Documentation

Enumerates the different clock types.

The virtual clock is the process clock and returns the amount of time the process was running in both kernel and process space. The system clock is the absolute processor clock.

Enumerator:
VIRTUAL 
SYSTEM 

Constructor & Destructor Documentation

crp::Timer::Timer ( Clock  clock_type = SYSTEM)

Creates a new timer.

crp::Timer::~Timer ( ) [inline]

Destructor does nothing.


Member Function Documentation

double crp::Timer::elapsed ( )

Returns the measured time in milliseconds (not neccessary integer)

Returns:
Measured time in milliseconds
bool crp::Timer::is_running ( )

Checks if the timer is started.

Returns:
True if the timer runs
void crp::Timer::start ( )

Starts measuring time.

void crp::Timer::stop ( )

Stops measuring time.


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