diff options
author | Carl Hetherington <carl@carlh.net> | 2012-01-14 22:02:59 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-01-14 22:02:59 +0000 |
commit | b087721d8aaf9470833414d01a72d826162946ab (patch) | |
tree | dc700fbb71685ab54eaa70b03ab53f35120f6155 /libs/ardour/ardour/cycle_timer.h | |
parent | d4bab8aeed61d7de331d5fb10230de78edfd423b (diff) |
Add some debug code to time things in the process
thread(s).
git-svn-id: svn://localhost/ardour2/branches/3.0@11246 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/cycle_timer.h')
-rw-r--r-- | libs/ardour/ardour/cycle_timer.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/libs/ardour/ardour/cycle_timer.h b/libs/ardour/ardour/cycle_timer.h index dc70204e82..35cc2a4c73 100644 --- a/libs/ardour/ardour/cycle_timer.h +++ b/libs/ardour/ardour/cycle_timer.h @@ -22,10 +22,13 @@ #include <string> #include <iostream> +#include <cstdlib> #include "ardour/cycles.h" #include "ardour/debug.h" +float get_mhz (); + class CycleTimer { private: static float cycles_per_usec; @@ -56,8 +59,34 @@ class CycleTimer { } #endif } +}; - static float get_mhz (); +class StoringTimer +{ +public: + StoringTimer (int); + void ref (); + void check (int); + void dump (std::string const &); + +private: + cycles_t _current_ref; + int* _point; + cycles_t* _value; + cycles_t* _ref; + int _points; + int _max_points; }; +#ifdef PT_TIMING +extern StoringTimer ST; +#define PT_TIMING_REF ST.ref(); +#define PT_TIMING_CHECK(x) ST.check(x); +#endif + +#ifndef PT_TIMING +#define PT_TIMING_REF +#define PT_TIMING_CHECK(x) +#endif + #endif /* __ardour_cycle_timer_h__ */ |