ardour
Public Member Functions | Private Attributes | List of all members
PBD::Timing Class Reference

#include <timing.h>

Public Member Functions

 Timing ()
 
bool valid () const
 
void start ()
 
void update ()
 
void reset ()
 
uint64_t get_interval ()
 
uint64_t elapsed () const
 Elapsed time in microseconds. More...
 

Private Attributes

uint64_t m_start_val
 
uint64_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 59 of file timing.h.

Constructor & Destructor Documentation

PBD::Timing::Timing ( )
inline

Definition at line 63 of file timing.h.

Member Function Documentation

uint64_t PBD::Timing::elapsed ( ) const
inline

Elapsed time in microseconds.

Definition at line 97 of file timing.h.

uint64_t PBD::Timing::get_interval ( )
inline

Definition at line 85 of file timing.h.

void PBD::Timing::reset ( )
inline

Definition at line 81 of file timing.h.

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

Definition at line 72 of file timing.h.

void PBD::Timing::update ( )
inline

Definition at line 77 of file timing.h.

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

Definition at line 68 of file timing.h.

Member Data Documentation

uint64_t PBD::Timing::m_last_val
private

Definition at line 104 of file timing.h.

uint64_t PBD::Timing::m_start_val
private

Definition at line 103 of file timing.h.


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