Skip to content

Commit

Permalink
Add a debug message, which appears when event in Mixxx application to…
Browse files Browse the repository at this point in the history
…ok longer than 20ms
  • Loading branch information
JoergAtGithub committed Oct 9, 2023
1 parent 19d80b5 commit 4ba370b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/mixxxapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class QMouseEventEditable : public QMouseEvent {
#endif
};

constexpr mixxx::Duration kEventNotifyExecTimeWarningThreshold = mixxx::Duration::fromMillis(20);

} // anonymous namespace
#endif

Expand Down Expand Up @@ -168,7 +170,23 @@ bool MixxxApplication::notify(QObject* target, QEvent* event) {
default:
break;
}
return QApplication::notify(target, event);

PerformanceTimer time;
time.start();

bool ret = QApplication::notify(target, event);

if (time.elapsed() > kEventNotifyExecTimeWarningThreshold) {
qDebug() << "Processing event type"
<< event->type()
<< "for object"
<< target->metaObject()->className()
<< target->objectName()
<< "took"
<< time.elapsed().debugMillisWithUnit();
}

return ret;
}

bool MixxxApplication::touchIsRightButton() {
Expand Down

0 comments on commit 4ba370b

Please sign in to comment.