13
0

add a new update() method to PBD::TimingStats to allow use of an already-computed interval

This commit is contained in:
Paul Davis 2021-06-11 15:38:36 -06:00
parent 0f6b9e759c
commit 462352102c

View File

@ -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 ();