humoto
Public Member Functions | Private Attributes | Friends | List of all members
humoto::Timer Class Reference

Detailed Description

Timer.

Definition at line 57 of file time.h.

#include <time.h>

Public Member Functions

 Timer ()
 Constructor. Starts the timer. More...
 
double get () const
 Returns the measured time interval (second). More...
 
void start ()
 Re/starts the timer. More...
 
double stop ()
 Stops the timer. More...
 

Private Attributes

struct timeval end_time
 
struct timeval start_time
 
double timediff
 

Friends

std::ostream & operator<< (std::ostream &out, const Timer &timer)
 Outputs the measured time interval. More...
 

Constructor & Destructor Documentation

◆ Timer()

humoto::Timer::Timer ( )
inline

Constructor. Starts the timer.

Definition at line 63 of file time.h.

Member Function Documentation

◆ get()

double humoto::Timer::get ( ) const
inline

Returns the measured time interval (second).

Returns
time interval (second).

Definition at line 96 of file time.h.

◆ start()

void humoto::Timer::start ( )
inline

Re/starts the timer.

Definition at line 73 of file time.h.

◆ stop()

double humoto::Timer::stop ( )
inline

Stops the timer.

Definition at line 82 of file time.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const Timer timer 
)
friend

Outputs the measured time interval.

Parameters
[in,out]outoutput stream.
[in]timerthe timer.
Returns
output stream.

Definition at line 110 of file time.h.

Member Data Documentation

◆ end_time

struct timeval humoto::Timer::end_time
private

Definition at line 125 of file time.h.

◆ start_time

struct timeval humoto::Timer::start_time
private

Definition at line 124 of file time.h.

◆ timediff

double humoto::Timer::timediff
private

Definition at line 126 of file time.h.


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