Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator Class Reference

#include <Timer.h>

Public Member Functions

double getElapsed () const
 Return the total elapsed wall-clock time.
 
size_t getNumberOfEntrances () const
 Return the number of times the code block was entered.
 
void increment (const double time_sec)
 Increment the elapsed wall-clock time and number of times the code block was entered.
 
void reset ()
 Reset the elapsed wall-clock time and number of times the code block was entered.
 
 TimeAccumulator ()=delete
 
 TimeAccumulator (const std::string &name)
 Instantiate the object.
 
std::string toString () const
 Return the timing summary as a string.
 

Private Attributes

double m_elapsed_sec {0.0}
 
std::string m_name
 
size_t m_number_of_entrances {0}
 

Detailed Description

Definition at line 57 of file Timer.h.

Constructor & Destructor Documentation

◆ TimeAccumulator() [1/2]

Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator::TimeAccumulator ( )
delete

◆ TimeAccumulator() [2/2]

Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator::TimeAccumulator ( const std::string &  name)

Instantiate the object.

Parameters
name:: custom name of the code block

Definition at line 98 of file Timer.cpp.

Member Function Documentation

◆ getElapsed()

double Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator::getElapsed ( ) const

Return the total elapsed wall-clock time.

Returns
:: elapsed time in seconds

Definition at line 118 of file Timer.cpp.

◆ getNumberOfEntrances()

size_t Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator::getNumberOfEntrances ( ) const

Return the number of times the code block was entered.

Returns
:: number of entrances

Definition at line 123 of file Timer.cpp.

◆ increment()

void Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator::increment ( const double  time_sec)

Increment the elapsed wall-clock time and number of times the code block was entered.

Parameters
time_sec:: elapsed time (seconds) to add

Definition at line 110 of file Timer.cpp.

Referenced by Mantid::Kernel::CodeBlockMultipleTimer::~CodeBlockMultipleTimer().

◆ reset()

void Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator::reset ( )

Reset the elapsed wall-clock time and number of times the code block was entered.

Definition at line 102 of file Timer.cpp.

◆ toString()

std::string Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator::toString ( ) const

Return the timing summary as a string.

Returns
:: timing summary

Definition at line 128 of file Timer.cpp.

Referenced by Mantid::Kernel::operator<<().

Member Data Documentation

◆ m_elapsed_sec

double Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator::m_elapsed_sec {0.0}
private

Definition at line 71 of file Timer.h.

◆ m_name

std::string Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator::m_name
private

Definition at line 70 of file Timer.h.

◆ m_number_of_entrances

size_t Mantid::Kernel::CodeBlockMultipleTimer::TimeAccumulator::m_number_of_entrances {0}
private

Definition at line 72 of file Timer.h.


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