STIR 6.4.0
stir::Timer Class Referenceabstract

A general base class for timers. Interface is like a stop watch. More...

#include "stir/Timer.h"

Inheritance diagram for stir::Timer:

Public Member Functions

void start (bool do_reset=false)
 start stopwatch, optionally resetting first
 
void stop ()
 stop stopwatch
 
void reset ()
 reset stopwatch
 
double value () const
 return value is undefined when start() is not called first.
 

Protected Member Functions

virtual double get_current_value () const =0
 

Protected Attributes

bool running
 
double previous_value
 
double previous_total_value
 

Detailed Description

A general base class for timers. Interface is like a stop watch.

Example of usage:
DerivedFromTimer t;
t.start();
// do things
cerr << t.value();
// do things
t.stop();
// do things
t.reset()
// etc
void stop(void)
Stop a running timer.
Definition HighResWallClockTimer.h:175
double value(void)
Returns the elapsed time (in seconds)
Definition HighResWallClockTimer.h:304
void start(bool bReset=false)
Start a timer.
Definition HighResWallClockTimer.h:145
void reset(void)
Reset a timer.
Definition HighResWallClockTimer.h:273

Derived classes simply have to implement the virtual function double get_current_value()

Member Function Documentation

◆ start()

◆ reset()


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