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

Timer. More...

#include <oomph_utilities.h>

Public Member Functions

 Timer (const unsigned &n_timer)
 Constructor: Specify number of timers.
 
void start (const unsigned &i)
 (Re-)start i-th timer
 
void halt (const unsigned &i)
 Halt i-th timer.
 
double cumulative_time (const unsigned &i)
 Report time accumulated by i-th timer.
 
void reset (const unsigned &i)
 Reset i-th timer.
 
void reset ()
 Reset all timers.
 
void set_ntimers (const unsigned &ntimers)
 Set number of timings that can be recorded in parallel.
 

Private Attributes

Vector< clock_tTiming
 Cumulative timings.
 
Vector< clock_tStart_time
 Start times of active timers.
 

Detailed Description

Timer.

Definition at line 365 of file oomph_utilities.h.

Constructor & Destructor Documentation

◆ Timer()

oomph::Timer::Timer ( const unsigned n_timer)
inline

Constructor: Specify number of timers.

Definition at line 369 of file oomph_utilities.h.

References set_ntimers().

Member Function Documentation

◆ cumulative_time()

double oomph::Timer::cumulative_time ( const unsigned i)
inline

Report time accumulated by i-th timer.

Definition at line 387 of file oomph_utilities.h.

References i, and Timing.

◆ halt()

void oomph::Timer::halt ( const unsigned i)
inline

Halt i-th timer.

Definition at line 381 of file oomph_utilities.h.

References i, Start_time, and Timing.

◆ reset() [1/2]

void oomph::Timer::reset ( )
inline

Reset all timers.

Definition at line 399 of file oomph_utilities.h.

References i, and Timing.

◆ reset() [2/2]

void oomph::Timer::reset ( const unsigned i)
inline

Reset i-th timer.

Definition at line 393 of file oomph_utilities.h.

References i, and Timing.

◆ set_ntimers()

void oomph::Timer::set_ntimers ( const unsigned ntimers)
inline

Set number of timings that can be recorded in parallel.

Definition at line 409 of file oomph_utilities.h.

References Start_time, and Timing.

Referenced by Timer().

◆ start()

void oomph::Timer::start ( const unsigned i)
inline

(Re-)start i-th timer

Definition at line 375 of file oomph_utilities.h.

References i, and Start_time.

Member Data Documentation

◆ Start_time

Vector<clock_t> oomph::Timer::Start_time
private

Start times of active timers.

Definition at line 420 of file oomph_utilities.h.

Referenced by halt(), set_ntimers(), and start().

◆ Timing

Vector<clock_t> oomph::Timer::Timing
private

Cumulative timings.

Definition at line 417 of file oomph_utilities.h.

Referenced by cumulative_time(), halt(), reset(), reset(), and set_ntimers().


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