Timing Class Reference

#include <Logger.h>


Public Member Functions

void printTimeDiffWithText (ostream &os, char *str, int iFactor=1000)
double getElapsedTime (int iFactor=1)
void restartTime ()

Static Public Member Functions

static double getTimeDifference (struct timeval t1, struct timeval t2)

Private Attributes

timeval time1


Detailed Description

This class holds a timer. This timer can be set (restartTime) and text can be printed with the elapsed time since the timer was restarted..

Definition at line 88 of file Logger.h.


Member Function Documentation

double Timing::getTimeDifference ( struct timeval  tv1,
struct timeval  tv2 
) [static]

This method returns the difference between two timevals in seconds.

Parameters:
tv1 first timeval
tv2 second timeval
Returns:
double representing the difference between t1 and t2 in seconds

Definition at line 357 of file Logger.cpp.

Referenced by getElapsedTime().

void Timing::printTimeDiffWithText ( ostream &  os,
char *  str,
int  iFactor = 1000 
)

This method prints the time in seconds that elapsed since the timer was restarted. It is possible to multiply this time with a factor, such that it can be used for different quantity values. In the default case this value is 1000 with the effect that the resulting value resembles miliseconds.

Parameters:
os output stream to which output should be written.
str that should be printed
iFactor with which the elapsed time is multiplied (default 1000)

Definition at line 373 of file Logger.cpp.

References getElapsedTime().

Referenced by Logger::logWithTime().

double Timing::getElapsedTime ( int  iFactor = 1  ) 

This method returns the time (in seconds) since the last time the timer was restarted.

Returns:
double seconds that have passed since last restart of timer

Definition at line 382 of file Logger.cpp.

References getTimeDifference(), and time1.

Referenced by Logger::logFromSignal(), Player::mainLoop(), printTimeDiffWithText(), and WorldModel::updateAll().

void Timing::restartTime (  ) 

This method restarts the timer by setting it to the current time

Definition at line 394 of file Logger.cpp.

References time1.

Referenced by Logger::Logger(), Player::mainLoop(), Logger::restartTimer(), and WorldModel::updateAll().


Field Documentation

struct timeval Timing::time1 [private]

Time the timer has last been restarted.

Definition at line 94 of file Logger.h.

Referenced by getElapsedTime(), and restartTime().


The documentation for this class was generated from the following files:
Generated on Thu Apr 26 22:45:32 2007 for GangOfSix(GOS)-RoboCupTeamProject by  doxygen 1.5.1-p1