HIBF 1.0.0-rc.1
All Classes Namespaces Files Functions Variables Typedefs Friends Macros Modules Pages Concepts
seqan::hibf::serial_timer Class Reference

A timer. More...

#include <hibf/misc/timer.hpp>

Public Member Functions

Constructors, destructor and assignment
 serial_timer ()=default
 Defaulted.
 
 serial_timer (serial_timer const &)=default
 Defaulted.
 
serial_timeroperator= (serial_timer const &)=default
 Defaulted.
 
 serial_timer (serial_timer &&)=default
 Defaulted.
 
serial_timeroperator= (serial_timer &&)=default
 Defaulted.
 
 ~serial_timer ()=default
 Defaulted.
 
Modification
void start ()
 Starts the timer.
 
void stop ()
 Stops the timer.
 
template<typename timer_t >
requires (std::same_as<timer_t, serial_timer> || std::same_as<timer_t, concurrent_timer>)
void operator+= (timer_t const &other)
 Adds another timer.
 
Access
double in_seconds () const
 Returns the measured time in seconds.
 
double max_in_seconds () const
 Returns the maximum measured time interval in seconds.
 
double avg_in_seconds () const
 Returns the average measured time interval in seconds.
 
Comparison
constexpr bool operator== (serial_timer const &) const
 Two timer are always equal.
 
constexpr bool operator== (concurrent_timer const &) const
 Two timer are always equal.
 

Friends

class concurrent_timer
 

Detailed Description

A timer.

Member Function Documentation

◆ stop()

void seqan::hibf::serial_timer::stop ( )
inline

Stops the timer.

In Debug mode, an assertion checks that start() has been called before.

◆ max_in_seconds()

double seqan::hibf::serial_timer::max_in_seconds ( ) const
inline

Returns the maximum measured time interval in seconds.

A time interval may be:

◆ avg_in_seconds()

double seqan::hibf::serial_timer::avg_in_seconds ( ) const
inline

Returns the average measured time interval in seconds.

A time interval may be:

The count used for averaging is the number of calls to stop() and operator+=().

Warning
Calling this function when neither stop() or operator+=() have been used is undefined behaviour.

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