WarpX
Public Member Functions | Private Attributes | List of all members
ablastr::utils::timer::Timer Class Reference

#include <Timer.H>

Public Member Functions

 Timer ()=default
 The constructor. More...
 
void record_start_time () noexcept
 This function records the start time. More...
 
void record_stop_time () noexcept
 This function records the stop time. More...
 
double get_duration () const noexcept
 This function returns the duration, calculated as the difference between the stop time and the start time (in seconds). More...
 
double get_global_duration () const
 This collective function returns the maximum duration recorded across all the MPI ranks (in seconds). More...
 

Private Attributes

double m_start_time
 
double m_stop_time
 

Detailed Description

This class implements a simple timer. It allows recording a start time and a stop time, and it provides methods to get the total duration, either local or global (i.e., the maximum duration recorder across all the MPI ranks).

Constructor & Destructor Documentation

◆ Timer()

ablastr::utils::timer::Timer::Timer ( )
default

The constructor.

Member Function Documentation

◆ get_duration()

double Timer::get_duration ( ) const
noexcept

This function returns the duration, calculated as the difference between the stop time and the start time (in seconds).

Returns
the duration

◆ get_global_duration()

double Timer::get_global_duration ( ) const

This collective function returns the maximum duration recorded across all the MPI ranks (in seconds).

Returns
the maximum duration across all the MPI ranks

◆ record_start_time()

void Timer::record_start_time ( )
noexcept

This function records the start time.

◆ record_stop_time()

void Timer::record_stop_time ( )
noexcept

This function records the stop time.

Member Data Documentation

◆ m_start_time

double ablastr::utils::timer::Timer::m_start_time
private

The start time

◆ m_stop_time

double ablastr::utils::timer::Timer::m_stop_time
private

The stop time


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