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

/////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// More...

#include <oomph_utilities.h>

Public Member Functions

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

Private Attributes

Vector< clock_t > Timing
 Cumulative timings. More...
 
Vector< clock_t > Start_time
 Start times of active timers. More...
 

Detailed Description

/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////

Timer

Definition at line 355 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 359 of file oomph_utilities.h.

References oomph::CumulativeTimings::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 377 of file oomph_utilities.h.

References i, and oomph::CumulativeTimings::Timing.

◆ halt()

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

Halt i-th timer.

Definition at line 371 of file oomph_utilities.h.

References i, oomph::CumulativeTimings::Start_time, and oomph::CumulativeTimings::Timing.

◆ reset() [1/2]

void oomph::Timer::reset ( )
inline

Reset all timers.

Definition at line 389 of file oomph_utilities.h.

References i, and oomph::CumulativeTimings::Timing.

◆ reset() [2/2]

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

Reset i-th timer.

Definition at line 383 of file oomph_utilities.h.

References i, and oomph::CumulativeTimings::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 399 of file oomph_utilities.h.

References oomph::CumulativeTimings::Start_time, and oomph::CumulativeTimings::Timing.

◆ start()

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

(Re-)start i-th timer

Definition at line 365 of file oomph_utilities.h.

References i, and oomph::CumulativeTimings::Start_time.

Member Data Documentation

◆ Start_time

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

Start times of active timers.

Definition at line 410 of file oomph_utilities.h.

◆ Timing

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

Cumulative timings.

Definition at line 407 of file oomph_utilities.h.


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