ARTEMIS
Timer.H
Go to the documentation of this file.
1 /* Copyright 2023 Luca Fedeli
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 
8 #ifndef ABLASTR_TIMER_H_
9 #define ABLASTR_TIMER_H_
10 
11 #include <AMReX_REAL.H>
12 
14 {
15 
21  class Timer
22  {
23  public:
24 
28  Timer();
29 
30 
34  void record_start_time() noexcept;
35 
36 
40  void record_stop_time() noexcept;
41 
42 
49  amrex::Real get_duration () noexcept;
50 
51 
58  amrex::Real get_global_duration ();
59 
60  private:
61 
62  amrex::Real m_start_time ;
63  amrex::Real m_stop_time ;
64  };
65 
66 }
67 
68 #endif //ABLASTR_TIMER_H_
Definition: Timer.H:22
amrex::Real get_duration() noexcept
This function returns the duration, calculated as the difference between the stop time and the start ...
Definition: Timer.cpp:29
void record_stop_time() noexcept
This function records the stop time.
Definition: Timer.cpp:23
Timer()
The constructor.
Definition: Timer.cpp:14
amrex::Real get_global_duration()
This collective function returns the maximum duration recorded across all the MPI ranks (in seconds).
Definition: Timer.cpp:35
amrex::Real m_stop_time
Definition: Timer.H:63
amrex::Real m_start_time
Definition: Timer.H:62
void record_start_time() noexcept
This function records the start time.
Definition: Timer.cpp:17
Definition: Timer.H:14