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

#include <Timer.H>

Public Member Functions

 Timer ()
 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...
 
amrex::Real get_duration () noexcept
 This function returns the duration, calculated as the difference between the stop time and the start time (in seconds). More...
 
amrex::Real get_global_duration ()
 This collective function returns the maximum duration recorded across all the MPI ranks (in seconds). More...
 

Private Attributes

amrex::Real m_start_time
 
amrex::Real 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()

Timer::Timer ( )

The constructor.

Member Function Documentation

◆ get_duration()

amrex::Real Timer::get_duration ( )
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()

amrex::Real Timer::get_global_duration ( )

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

amrex::Real ablastr::utils::timer::Timer::m_start_time
private

The start time

◆ m_stop_time

amrex::Real ablastr::utils::timer::Timer::m_stop_time
private

The stop time


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