commit 019d43c228acbca38236f6f1c05c406d242703ce
parent 055af01935ad12bcbece7622037131e4a74d3ede
Author: Kyle Milz <kyle@0x30.net>
Date: Sat, 30 Jul 2016 20:20:55 -0600
src: fix a bug in frame delta init
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/term_main.cc b/src/term_main.cc
@@ -56,8 +56,9 @@ CursesViewer::CursesViewer(af_unix &socket) :
m_cur_tu = m_tus[0];
+ struct timespec one_fiftieth = { 0, 1 * 1000 * 1000 * 1000 / 50 };
for (int i = 0; i < 50; i++) {
- m_frame_deltas.push(m_sleep);
+ m_frame_deltas.push(one_fiftieth);
m_execution_history.push(0);
}
}
@@ -166,12 +167,11 @@ CursesViewer::print_statusbar()
void
CursesViewer::update_execs()
{
- // Add the newest execution count to the floating average.
- m_exec_floating_avg += m_total_executions;
-
// Push on new data and pop old data off. Subtracts the oldest
// execution count from the floating average.
+ m_exec_floating_avg += m_total_executions;
m_execution_history.push(m_total_executions);
+
m_exec_floating_avg -= m_execution_history.front();
m_execution_history.pop();