WarpX
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 
12 {
13 
19  class Timer
20  {
21  public:
22 
26  Timer();
27 
28 
32  void record_start_time() noexcept;
33 
34 
38  void record_stop_time() noexcept;
39 
40 
47  double get_duration () noexcept;
48 
49 
56  double get_global_duration ();
57 
58  private:
59 
60  double m_start_time ;
61  double m_stop_time ;
62  };
63 
64 }
65 
66 #endif //ABLASTR_TIMER_H_
Definition: Timer.H:20
void record_stop_time() noexcept
This function records the stop time.
Definition: Timer.cpp:23
double m_stop_time
Definition: Timer.H:61
Timer()
The constructor.
Definition: Timer.cpp:14
double get_duration() noexcept
This function returns the duration, calculated as the difference between the stop time and the start ...
Definition: Timer.cpp:29
double m_start_time
Definition: Timer.H:60
void record_start_time() noexcept
This function records the start time.
Definition: Timer.cpp:17
double get_global_duration()
This collective function returns the maximum duration recorded across all the MPI ranks (in seconds).
Definition: Timer.cpp:35
Definition: Timer.H:12