From: Soeren Apel Date: Thu, 18 Apr 2019 21:02:31 +0000 (+0200) Subject: Session: Measure acquisition time X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=268fd2b807aef342b5a4dfec9e6d27103fb7df94;p=pulseview.git Session: Measure acquisition time --- diff --git a/pv/session.cpp b/pv/session.cpp index ae29f6a9..245889d6 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -820,6 +820,11 @@ void Session::set_capture_state(capture_state state) { bool changed; + if (state == Running) + acq_time_.start(); + if (state == Stopped) + qDebug("Acquisition took %.2f s", acq_time_.elapsed() / 1000.); + { lock_guard lock(sampling_mutex_); changed = capture_state_ != state; diff --git a/pv/session.hpp b/pv/session.hpp index 345baea4..1dd48c95 100644 --- a/pv/session.hpp +++ b/pv/session.hpp @@ -38,6 +38,7 @@ #include #include #include +#include #ifdef ENABLE_FLOW #include @@ -305,6 +306,8 @@ private: bool data_saved_; bool frame_began_; + QTime acq_time_; + #ifdef ENABLE_FLOW RefPtr pipeline_; RefPtr source_;