75 return (m_start_val != 0 && m_last_val != 0);
88 m_last_val = interval;
92 m_start_val = m_last_val = 0;
99 elapsed = m_last_val - m_start_val;
100 m_start_val = m_last_val;
106 bool started()
const {
return m_start_val != 0; }
110 return m_last_val - m_start_val;
115 return elapsed () / 1000;
149 if (m_start_val <= 0 || m_last_val <= 0 || m_start_val > m_last_val) {
165 _min = std::numeric_limits<microseconds_t>::max();
187 avg = _avg / (double)_cnt;
188 dev = sqrt (_vs / ((
double) _cnt - 1.0));
197 _avg += (double) diff;
209 const double ela = (double) diff;
210 const double var_m1 = _vm;
211 _vm = _vm + (ela - _vm) / (1.0 + (
double) _cnt);
212 _vs = _vs + (ela - _vm) * (ela - var_m1);
264 if (m_timing.valid()) {
265 m_elapsed_values.push_back (m_timing.elapsed());
271 m_elapsed_values.push_back (interval);
275 m_elapsed_values.clear ();
276 m_elapsed_values.reserve (m_reserve_size);
289 { m_reserve_size = reserve_size;
reset (); }
291 std::vector<microseconds_t>::size_type
size ()
const
292 {
return m_elapsed_values.size(); }
309 m_data.start_timing ();
314 m_data.add_elapsed ();
TimerRAII(TimingStats &ts, bool dbg=false)
std::vector< microseconds_t >::size_type size() const
bool get_min_max_avg_total(microseconds_t &min, microseconds_t &max, microseconds_t &avg, microseconds_t &total) const
std::string summary() const
std::vector< microseconds_t > m_elapsed_values
void reserve(uint32_t reserve_size)
bool get_stats(microseconds_t &min, microseconds_t &max, double &avg, double &dev) const
void update(microseconds_t interval)
microseconds_t elapsed() const
microseconds_t start_time() const
microseconds_t m_last_val
microseconds_t m_start_val
microseconds_t elapsed_msecs() const
microseconds_t get_interval()
microseconds_t last_time() const
WaitTimerRAII(TimingStats &ts)
PBD::PropertyDescriptor< timepos_t > start
bool get_min_max_avg_total(const std::vector< microseconds_t > &values, microseconds_t &min, microseconds_t &max, microseconds_t &avg, microseconds_t &total)
microseconds_t get_microseconds()
std::string timing_summary(const std::vector< microseconds_t > &values)