From d9a3668586780594eb5260535ce45c9a0b6f1c1c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 29 Apr 2019 15:57:20 +0200 Subject: logic/pipeline: debug sleep times --- logic/pipeline.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'logic') diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp index 4cf52e54..9d783952 100644 --- a/logic/pipeline.cpp +++ b/logic/pipeline.cpp @@ -481,15 +481,16 @@ ok: } #ifdef DEBUG_TIMINGS -static void debug_timings(float backlog_time) +static void debug_timings(float backlog_time, int sleep_time) { - static variance v; + static variance v, v2; static Timer t, t2; static unsigned cnt, k; if (k > 1000) { v.input((double)backlog_time); + v2.input(sleep_time); if (t.elapsed_ms() >= 1000) { @@ -497,7 +498,9 @@ static void debug_timings(float backlog_time) qDebug() << cnt << "Hz:" << "backlog" << "avg" << v.avg() - << "stddev" << v.stddev(); + << "dev" << v.stddev() + << "| sleep" << v2.avg() + << "dev" << v2.stddev(); cnt = 0; } @@ -565,7 +568,7 @@ void pipeline::run() ms{0}, ms{10}).count(); #ifdef DEBUG_TIMINGS - debug_timings(backlog_time.count()); + debug_timings(backlog_time.count(), sleep_ms); #endif portable::sleep(sleep_ms); } -- cgit v1.2.3