Ardour  9.0-pre0-582-g084a23a80d
PBD::Timing Class Reference

#include <timing.h>

Inheritance diagram for PBD::Timing:
[legend]

Public Member Functions

 Timing ()
 
bool valid () const
 
void start ()
 
void update ()
 
void update (microseconds_t interval)
 
void reset ()
 
microseconds_t get_interval ()
 
bool started () const
 
microseconds_t elapsed () const
 
microseconds_t elapsed_msecs () const
 
microseconds_t start_time () const
 
microseconds_t last_time () const
 

Protected Attributes

microseconds_t m_start_val
 
microseconds_t m_last_val
 

Detailed Description

This class allows collecting timing data using two different techniques. The first is using start() and update() and then calling elapsed() to get the elapsed time. This is useful when you want to measure the elapsed time between two different execution points. e.g

timing.start(); do_stuff(); timing.update(); cerr << "do_stuff took: " << timing.elapsed() << "usecs" << endl;

The other is timing intervals using start() and calling get_interval() periodically to measure the time intervals between the same execution point. The difference is necessary to get the most accurate timing information when timing intervals but I didn't feel it necessary to have two separate classes.

Definition at line 65 of file timing.h.

Constructor & Destructor Documentation

◆ Timing()

PBD::Timing::Timing ( )
inline

Definition at line 69 of file timing.h.

Member Function Documentation

◆ elapsed()

microseconds_t PBD::Timing::elapsed ( ) const
inline
Returns
Elapsed time in microseconds

Definition at line 109 of file timing.h.

◆ elapsed_msecs()

microseconds_t PBD::Timing::elapsed_msecs ( ) const
inline
Returns
Elapsed time in milliseconds

Definition at line 114 of file timing.h.

◆ get_interval()

microseconds_t PBD::Timing::get_interval ( )
inline

Definition at line 95 of file timing.h.

◆ last_time()

microseconds_t PBD::Timing::last_time ( ) const
inline

Definition at line 119 of file timing.h.

◆ reset()

void PBD::Timing::reset ( )
inline

Definition at line 91 of file timing.h.

◆ start()

void PBD::Timing::start ( void  )
inline

Definition at line 78 of file timing.h.

◆ start_time()

microseconds_t PBD::Timing::start_time ( ) const
inline

Definition at line 118 of file timing.h.

◆ started()

bool PBD::Timing::started ( ) const
inline

Definition at line 106 of file timing.h.

◆ update() [1/2]

void PBD::Timing::update ( )
inline

Definition at line 83 of file timing.h.

◆ update() [2/2]

void PBD::Timing::update ( microseconds_t  interval)
inline

Definition at line 86 of file timing.h.

◆ valid()

bool PBD::Timing::valid ( ) const
inline

Definition at line 74 of file timing.h.

Member Data Documentation

◆ m_last_val

microseconds_t PBD::Timing::m_last_val
protected

Definition at line 123 of file timing.h.

◆ m_start_val

microseconds_t PBD::Timing::m_start_val
protected

Definition at line 122 of file timing.h.


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