From c4dcf89fde9b2b86410bdb387496a2599bd2e987 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 13 May 2021 23:57:26 +1000 Subject: [PATCH] task: print duration of task to debug Useful for performance testing --- app/task/task.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/task/task.h b/app/task/task.h index a711d9483..cf32cd206 100644 --- a/app/task/task.h +++ b/app/task/task.h @@ -23,6 +23,7 @@ #include #include +#include #include #include "common/cancelableobject.h" @@ -93,7 +94,12 @@ public slots: { start_time_ = QDateTime::currentMSecsSinceEpoch(); - return Run(); + bool ret = Run(); + + // Print how long this task took for debugging purposes + qDebug() << this << "took" << (QDateTime::currentMSecsSinceEpoch() - start_time_); + + return ret; } /**