ARTS
2.3.1285(git:92a29ea9-dirty)
|
#include <timings.h>
Public Member Functions | |
Timings () | |
Simple Constructor. More... | |
Index | add_timer (String name) |
Add timer. More... | |
Numeric | get_time () |
Get Wall Time. More... | |
void | mark (Index i) |
Start/Stop Timings. More... | |
Private Attributes | |
Index | ntimers |
Index | nrunning |
Numeric | total_time |
Numeric | stamp |
std::vector< bool > | running |
std::vector< Numeric > | times |
std::vector< Numeric > | stamps |
std::vector< String > | names |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Timings &timer) |
Print timing results. More... | |
Timings Class.
Simple class that handles a variable number of timers and computes the total time. The Timings class uses the OMP library to measure the runtime and therefore only works correctly if OMP is available.
|
inline |
|
inline |
|
inline |
Start/Stop Timings.
Starts or stops the timer with the given index. The indices of the timers reflect the order in which the timers have been added to the Timings object starting with 0 for the first timer. If the given timer is not running currently, it is started. If it is running, it is stopped and the passed time added to the total time of the timer.
Definition at line 80 of file timings.h.
References get_time(), i, nrunning, ntimers, running, stamp, stamps, times, and total_time.
|
friend |
Print timing results.
Prints the timing results to the given output stream.
os | The output stream to write the timin results to. |
timer | The Timings object. |
Definition at line 18 of file timings.cc.
|
private |
Definition at line 110 of file timings.h.
Referenced by add_timer(), and operator<<().
|
private |
|
private |
Definition at line 106 of file timings.h.
Referenced by add_timer(), mark(), and Timings().
|
private |
Definition at line 108 of file timings.h.
Referenced by add_timer(), and mark().
|
private |
|
private |
Definition at line 109 of file timings.h.
Referenced by add_timer(), and mark().
|
private |
Definition at line 109 of file timings.h.
Referenced by add_timer(), mark(), and operator<<().
|
private |
Definition at line 107 of file timings.h.
Referenced by mark(), operator<<(), and Timings().