aboutsummaryrefslogtreecommitdiff
path: root/logging.h
diff options
context:
space:
mode:
Diffstat (limited to 'logging.h')
-rw-r--r--logging.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/logging.h b/logging.h
index aaeceeac..ae7e0332 100644
--- a/logging.h
+++ b/logging.h
@@ -18,6 +18,7 @@
#pragma once
+#include <QtCore/QElapsedTimer>
#include <QtCore/QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(MAIN)
@@ -65,3 +66,13 @@ namespace QMatrixClient
return qdm(debug_object);
}
}
+
+inline QDebug operator<< (QDebug debug_object, const QElapsedTimer& et)
+{
+ auto val = et.nsecsElapsed() / 1000;
+ if (val < 1000)
+ debug_object << val << u"µs";
+ else
+ debug_object << val / 1000 << "ms";
+ return debug_object;
+}