EpuckTimer Class Reference

A timer class. More...

#include <timer.hpp>

Collaboration diagram for EpuckTimer:
Collaboration graph

Detailed Description

A timer class.

Provides a timer with resolution of milliseconds.

Author
Renato Florentino Garcia
Date
August 2008

Public Member Functions

double initialize (double startTime=0.0)
 Set the start time. More...
 
double elapsedTime ()
 Get the time elapsed since the initialization. More...
 
void resetInterval ()
 Start a new interval. More...
 
double intervalDelay ()
 Get the time elapsed since the last call at resetInterval. More...
 

Private Member Functions

double currentTime ()
 

Private Attributes

double offset
 
struct TIMEB t
 
double t0
 
double t1
 
double t2
 
bool intervalRunning
 

Member Function Documentation

◆ elapsedTime()

double EpuckTimer::elapsedTime ( )
inline

Get the time elapsed since the initialization.

Get the time elapsed since the initialization, plus the offset that was given.

Returns
The elapsed time, in seconds.

◆ initialize()

double EpuckTimer::initialize ( double  startTime = 0.0)
inline

Set the start time.

Parameters
startTimeStart time offset in seconds.
Returns
The start time, i.e. the time since 00:00:00 UTC in seconds.

◆ intervalDelay()

double EpuckTimer::intervalDelay ( )
inline

Get the time elapsed since the last call at resetInterval.

Return the elapsed time since resetInterval was called at last time. Case it wasn't yet called the delta time will be 0.

Returns
The elapsed time in seconds.

Referenced by EpuckPosition2d::UpdateOdometry().

◆ resetInterval()

void EpuckTimer::resetInterval ( )
inline

Start a new interval.

Start a new interval which will be intervalDelay.

Referenced by EpuckPosition2d::UpdateOdometry().


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