Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
Chrono Class Reference

Elapsed real-time timer. More...

#include <Chrono.h>

Public Member Functions

 Chrono ()
 default constructor
 Chrono (double)
 new chrono that starts directly at the given time
double get () const
 if running, get the value (start time - now) without stopping the chrono, else get (start time - stop time) value this method is declared to be const, because we need to call it in << (and of course, no data member is modified
void hold (bool)
 pause the chrono if the parameter is true
void reset ()
 reset to zero
void start ()
 start at zero
void start (double)
 start at a given value
double stop ()
 stop chrono
 ~Chrono ()=default

Friends

std::ostream & operator<< (std::ostream &o, const Chrono c)
 print the value of the chrono on the stream

Detailed Description

Elapsed real-time timer.

Allows one to measure elapsed real time. You can start, stop, reset and of course get and print the current values of this chronometer.

Constructor & Destructor Documentation

◆ Chrono() [1/2]

Chrono::Chrono ( )

default constructor

Referenced by operator<<, and ~Chrono().

◆ Chrono() [2/2]

Chrono::Chrono ( double init)

new chrono that starts directly at the given time

◆ ~Chrono()

Chrono::~Chrono ( )
default

References Chrono().

Member Function Documentation

◆ get()

double Chrono::get ( ) const

if running, get the value (start time - now) without stopping the chrono, else get (start time - stop time) value this method is declared to be const, because we need to call it in << (and of course, no data member is modified

Referenced by operator<<.

◆ hold()

void Chrono::hold ( bool pause)

pause the chrono if the parameter is true

References start(), and stop().

◆ reset()

void Chrono::reset ( )

reset to zero

◆ start() [1/2]

void Chrono::start ( )

start at zero

Referenced by InteractiveMonitoringManager::doMove(), hold(), and start().

◆ start() [2/2]

void Chrono::start ( double init)

start at a given value

References start().

◆ stop()

double Chrono::stop ( )

stop chrono

Referenced by InteractiveMonitoringManager::doMove(), and hold().

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const Chrono c )
friend

print the value of the chrono on the stream

References Chrono(), and get().


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