diff --git a/libs/pbd/pbd/timing.h b/libs/pbd/pbd/timing.h index fa246bc554..4c3597ce44 100644 --- a/libs/pbd/pbd/timing.h +++ b/libs/pbd/pbd/timing.h @@ -83,6 +83,10 @@ public: void update () { m_last_val = g_get_monotonic_time (); } + void update (uint64_t interval) { + m_start_val = 0; + m_last_val = interval; + } void reset () { m_start_val = m_last_val = 0; @@ -134,6 +138,17 @@ public: } } + /* interval computed externally */ + void update (uint64_t interval) + { + /* throw away the first 1000 values */ + if (_update_cnt++ < 1000) { + return; + } + Timing::update (interval); + calc (); + } + void reset () { Timing::reset ();