Public Member Functions | Private Attributes
Timer Class Reference

A timer object to measure elapsed time. More...

#include <Timer.hpp>

List of all members.

Public Member Functions

TimeDuration elapsed () const
UINT32 elapsedMicroseconds () const
 Returns the elapsed time in microseconds since the timer was started or restarted.
UINT32 elapsedMicrosecondsSinceLastCall ()
 Elapsed us since the last call of this function.
UINT32 elapsedMilliseconds () const
 Returns the elapsed time in milliseconds since the timer was started or restarted.
UINT32 elapsedMillisecondsSinceLastCall ()
 Elapsed ms since the last call of this function.
bool isElapsed ()
void reset ()
void restart ()
 Restarts the timer.
void startWatchdog (TimeDuration watchdogTime)
 Timer ()
 Constructor.
virtual ~Timer ()
 Destructor.

Private Attributes

Time m_startTime
TimeDuration m_watchdogTime

Detailed Description

A timer object to measure elapsed time.

This class is intended for simple timing diagnostics during debug phase. For a more accurate profiling of your code use a profiler like valgrind or similar.

Due to accuracy differences on various platforms for Windows PCs and Linux PCs implementations and accuracy may differ.

Definition at line 24 of file Timer.hpp.


Constructor & Destructor Documentation

Constructor.

The timer is started, with the construction of an instance.

Definition at line 11 of file Timer.cpp.

Timer::~Timer ( ) [virtual]

Destructor.

Definition at line 16 of file Timer.cpp.


Member Function Documentation

"Jetzt" Elapsed time since last start or restart, in [s].

Definition at line 78 of file Timer.cpp.

Returns the elapsed time in microseconds since the timer was started or restarted.

Elapsed time since last restart, in [us]

Definition at line 105 of file Timer.cpp.

Elapsed us since the last call of this function.

Documentation see "elapsedMillisecondsSinceLastCall()", but it measures microseconds instead.

Definition at line 141 of file Timer.cpp.

Returns the elapsed time in milliseconds since the timer was started or restarted.

Elapsed time since last restart, in [ms]

Definition at line 95 of file Timer.cpp.

Elapsed ms since the last call of this function.

Elapsed time since last call to this function, in [ms]. This function may be called without restarts as it measures the time between consecutive calls to this function. Usage:

t; // ... t.elapsedMillisecondsSinceLastCall(); // ... functions to be timed ... UINT32 time1 = t.elapsedMillisecondsSinceLastCall(); // ... next functions to be timed ... UINT32 time2 = t.elapsedMillisecondsSinceLastCall(); // ...

Thats it!

Definition at line 130 of file Timer.cpp.

bool Timer::isElapsed ( )

Definition at line 32 of file Timer.cpp.

void Timer::reset ( )

Definition at line 48 of file Timer.cpp.

void Timer::restart ( )

Restarts the timer.

Definition at line 56 of file Timer.cpp.

void Timer::startWatchdog ( TimeDuration  watchdogTime)

Definition at line 23 of file Timer.cpp.


Member Data Documentation

Definition at line 64 of file Timer.hpp.

Definition at line 65 of file Timer.hpp.


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


libsick_ldmrs
Author(s): SICK AG , Martin G√ľnther , Jochen Sprickerhof
autogenerated on Wed Jun 14 2017 04:04:50