]> sigrok.org Git - pulseview.git/commitdiff
Session: Measure acquisition time
authorSoeren Apel <redacted>
Thu, 18 Apr 2019 21:02:31 +0000 (23:02 +0200)
committerSoeren Apel <redacted>
Thu, 18 Apr 2019 21:03:13 +0000 (23:03 +0200)
pv/session.cpp
pv/session.hpp

index ae29f6a9c4d5b135242dc4426fc6b1837ba6f89f..245889d65488e5c54f41eff9f9e4664c26b98c41 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 345baea49d52b566fe8aaa920f347b8938118982..1dd48c95c5ea0e994204151fbd100c7593bd89a7 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_;