Classes | Public Member Functions | Private Attributes | List of all members
lvr2::Timestamp Class Reference

A helper class for automated time stamping. Timing is started as soon as an object of this class is created. To time some parts of a program, just create a new object and use the provided output operator to display the elapsed time. More...

#include <Timestamp.hpp>

Classes

class  NullBuffer
 

Public Member Functions

unsigned long getCurrentTimeInMs () const
 Returns the current system time in milliseconds. More...
 
double getCurrentTimeinS () const
 Returns the current system time in seconds. More...
 
string getElapsedTime () const
 Returns a string representation of the current timer value. More...
 
unsigned long getElapsedTimeInMs () const
 Returns the milliseconds since object creation. More...
 
double getElapsedTimeInS () const
 Returns the time since instantiation in seconds. More...
 
ostream & getNullStream ()
 
bool isQuiet ()
 
void resetTimer ()
 Resets the internal timer. More...
 
void setQuiet (bool quiet)
 
 Timestamp ()
 Constructor. More...
 

Private Attributes

NullBuffer m_nullBuffer
 
std::ostream m_nullStream
 
bool m_quiet
 
unsigned long m_startTime
 The system at object instantiation. More...
 

Detailed Description

A helper class for automated time stamping. Timing is started as soon as an object of this class is created. To time some parts of a program, just create a new object and use the provided output operator to display the elapsed time.

Definition at line 53 of file Timestamp.hpp.

Constructor & Destructor Documentation

◆ Timestamp()

lvr2::Timestamp::Timestamp ( )

Constructor.

Definition at line 103 of file Timestamp.cpp.

Member Function Documentation

◆ getCurrentTimeInMs()

unsigned long lvr2::Timestamp::getCurrentTimeInMs ( ) const

Returns the current system time in milliseconds.

Definition at line 109 of file Timestamp.cpp.

◆ getCurrentTimeinS()

double lvr2::Timestamp::getCurrentTimeinS ( ) const

Returns the current system time in seconds.

Definition at line 121 of file Timestamp.cpp.

◆ getElapsedTime()

string lvr2::Timestamp::getElapsedTime ( ) const

Returns a string representation of the current timer value.

Definition at line 136 of file Timestamp.cpp.

◆ getElapsedTimeInMs()

unsigned long lvr2::Timestamp::getElapsedTimeInMs ( ) const

Returns the milliseconds since object creation.

Definition at line 116 of file Timestamp.cpp.

◆ getElapsedTimeInS()

double lvr2::Timestamp::getElapsedTimeInS ( ) const

Returns the time since instantiation in seconds.

Definition at line 126 of file Timestamp.cpp.

◆ getNullStream()

ostream& lvr2::Timestamp::getNullStream ( )
inline

Definition at line 97 of file Timestamp.hpp.

◆ isQuiet()

bool lvr2::Timestamp::isQuiet ( )
inline

Definition at line 95 of file Timestamp.hpp.

◆ resetTimer()

void lvr2::Timestamp::resetTimer ( )

Resets the internal timer.

Definition at line 131 of file Timestamp.cpp.

◆ setQuiet()

void lvr2::Timestamp::setQuiet ( bool  quiet)
inline

Definition at line 87 of file Timestamp.hpp.

Member Data Documentation

◆ m_nullBuffer

NullBuffer lvr2::Timestamp::m_nullBuffer
private

Definition at line 111 of file Timestamp.hpp.

◆ m_nullStream

std::ostream lvr2::Timestamp::m_nullStream
private

Definition at line 112 of file Timestamp.hpp.

◆ m_quiet

bool lvr2::Timestamp::m_quiet
private

Definition at line 110 of file Timestamp.hpp.

◆ m_startTime

unsigned long lvr2::Timestamp::m_startTime
private

The system at object instantiation.

Definition at line 109 of file Timestamp.hpp.


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


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:12