TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::utility::timer

#include <triqs/utility/timer.hpp>

Detailed Description

Accumulating wall-clock timer based on std::chrono::high_resolution_clock.

It accumulates total elapsed time across multiple start() and stop() intervals. The current total time in seconds, including any in-progress interval, can be retrieved by conversion to double.

Definition at line 39 of file timer.hpp.

Public Types

using clock_t = std::chrono::high_resolution_clock
 Underlying clock type.

Public Member Functions

bool is_running () const
 Whether the timer is currently running.
 operator double () const
 Implicit conversion to double (seconds).
void reset ()
 Reset the accumulated time to zero and put the timer in the stopped state.
void start ()
 Start (or resume) the timer.
void stop ()
 Stop the timer and add the elapsed interval to the running total.

Member Function Documentation

◆ is_running()

bool triqs::utility::timer::is_running ( ) const
inlinenodiscard

Whether the timer is currently running.

Returns
True if the timer is running, false if it is stopped.

Definition at line 72 of file timer.hpp.

◆ operator double()

triqs::utility::timer::operator double ( ) const
inline

Implicit conversion to double (seconds).

Returns
The total accumulated time in seconds, including any in-progress interval if the timer is running.

Definition at line 78 of file timer.hpp.


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