Session: Measure acquisition time
authorSoeren Apel <soeren@apelpie.net>
Thu, 18 Apr 2019 21:02:31 +0000 (23:02 +0200)
committerSoeren Apel <soeren@apelpie.net>
Thu, 18 Apr 2019 21:03:13 +0000 (23:03 +0200)
pv/session.cpp
pv/session.hpp

index ae29f6a..245889d 100644 (file)
@@ -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<mutex> lock(sampling_mutex_);
                changed = capture_state_ != state;
index 345baea..1dd48c9 100644 (file)
@@ -38,6 +38,7 @@
 #include <QObject>
 #include <QSettings>
 #include <QString>
+#include <QTime>
 
 #ifdef ENABLE_FLOW
 #include <gstreamermm.h>
@@ -305,6 +306,8 @@ private:
        bool data_saved_;
        bool frame_began_;
 
+       QTime acq_time_;
+
 #ifdef ENABLE_FLOW
        RefPtr<Pipeline> pipeline_;
        RefPtr<Element> source_;