From 282a550f6223f95f7251be8a719b1b62fa063fb5 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 24 Jan 2016 17:00:06 +0100 Subject: Nicer rate printout --- repetitionrate.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/repetitionrate.cpp b/repetitionrate.cpp index 1c06c4c..c407c18 100644 --- a/repetitionrate.cpp +++ b/repetitionrate.cpp @@ -22,7 +22,7 @@ #include "repetitionrate.hpp" #include #include -#include +#include using namespace std; @@ -50,7 +50,7 @@ struct FIGRateInfo { vector frames_complete; // Which FIBs this FIG was seen in - unordered_set in_fib; + set in_fib; }; @@ -109,9 +109,13 @@ void rate_display_analysis(bool clear) fig_rate.first.figtype, fig_rate.first.figextension, n_present_per_second, n_present, variance_of_delta_present); } + else { + printf("FIG%2d/%2d 0\n", + fig_rate.first.figtype, fig_rate.first.figextension); + } const size_t n_complete = frames_complete.size(); - if (n_complete) { + if (n_present and n_complete) { double average_complete_interval = (double)(frames_complete.back() - frames_complete.front()) / @@ -131,13 +135,16 @@ void rate_display_analysis(bool clear) const double n_complete_per_second = 1 / (average_complete_interval * frame_duration); - printf(" %2.2f (%6zu %2.2f)\n", + printf(" %2.2f (%6zu %2.2f)", n_complete_per_second, n_complete, variance_of_delta_complete); } - else { - printf("FIG%2d/%2d 0\n", - fig_rate.first.figtype, fig_rate.first.figextension); + + printf(" in FIB(s): "); + for (auto& fib : fig_rate.second.in_fib) { + printf("%d ", fib); } + printf("\n"); + } if (clear) { -- cgit v1.2.3