Ardour  8.12
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 66 of file timing.h.

Constructor & Destructor Documentation

◆ Timing()

PBD::Timing::Timing ( )
inline

Definition at line 70 of file timing.h.

Member Function Documentation

◆ elapsed()

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

Definition at line 110 of file timing.h.

◆ elapsed_msecs()

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

Definition at line 115 of file timing.h.

◆ get_interval()

microseconds_t PBD::Timing::get_interval ( )
inline

Definition at line 96 of file timing.h.

◆ last_time()

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

Definition at line 120 of file timing.h.

◆ reset()

void PBD::Timing::reset ( )
inline

Definition at line 92 of file timing.h.

◆ start()

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

Definition at line 79 of file timing.h.

◆ start_time()

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

Definition at line 119 of file timing.h.

◆ started()

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

Definition at line 107 of file timing.h.

◆ update() [1/2]

void PBD::Timing::update ( )
inline

Definition at line 84 of file timing.h.

◆ update() [2/2]

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

Definition at line 87 of file timing.h.

◆ valid()

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

Definition at line 75 of file timing.h.

Member Data Documentation

◆ m_last_val

microseconds_t PBD::Timing::m_last_val
protected

Definition at line 124 of file timing.h.

◆ m_start_val

microseconds_t PBD::Timing::m_start_val
protected

Definition at line 123 of file timing.h.


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