Skip to content

Commit

Permalink
ui_builder: perf test
Browse files Browse the repository at this point in the history
  • Loading branch information
vladisslav2011 committed Apr 14, 2024
1 parent 67156ef commit 4ca7856
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/applications/gqrx/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ using namespace std::chrono_literals;

Q_DECLARE_METATYPE(c_id)
Q_DECLARE_METATYPE(c_def::v_union)
using std::chrono::high_resolution_clock;
using std::chrono::duration_cast;
using std::chrono::duration;
using std::chrono::milliseconds;

MainWindow::MainWindow(const QString& cfgfile, bool edit_conf, QWidget *parent) :
QMainWindow(parent),
Expand All @@ -80,6 +84,7 @@ MainWindow::MainWindow(const QString& cfgfile, bool edit_conf, QWidget *parent)
dec_afsk1200(nullptr),
waterfall_background_thread(&MainWindow::waterfall_background_func,this)
{
auto t1 = high_resolution_clock::now();
qRegisterMetaType<c_id>();
qRegisterMetaType<c_def::v_union>();

Expand Down Expand Up @@ -390,7 +395,9 @@ MainWindow::MainWindow(const QString& cfgfile, bool edit_conf, QWidget *parent)

// Create list of input devices. This must be done before the configuration is
// restored because device probing might change the device configuration
auto t2 = high_resolution_clock::now();
CIoConfig::getDeviceList(devList);
auto t3 = high_resolution_clock::now();

m_recent_config = new RecentConfig(m_cfg_dir, ui->menu_RecentConfig);
connect(m_recent_config, SIGNAL(loadConfig(const QString &)), this, SLOT(loadConfigSlot(const QString &)));
Expand Down Expand Up @@ -433,6 +440,11 @@ MainWindow::MainWindow(const QString& cfgfile, bool edit_conf, QWidget *parent)
{
emit sigSaveProgress(saved_ms);
});
auto t4 = high_resolution_clock::now();
duration<double, std::milli> diff = (t2 - t1) + (t4 - t3);
std::cout << "*********************************\n"
"* started in "<<diff.count()<<" ms\n"
"*********************************\n";
}

MainWindow::~MainWindow()
Expand Down

0 comments on commit 4ca7856

Please sign in to comment.