From af520c8ef32aef67b4e06c60c4fdb49338afeb38 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 22 May 2016 12:07:28 -0700 Subject: Use QDeadlineTimer in qlogging.cpp No change, just shorter code. Change-Id: I25d85d86649448d5b2b3fffd1450f95b0ec66927 Reviewed-by: Lars Knoll --- src/corelib/global/qlogging.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 04468d7aac..748ca60661 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -53,6 +53,7 @@ #include "qloggingcategory.h" #ifndef QT_BOOTSTRAPPED #include "qelapsedtimer.h" +#include "qdeadlinetimer.h" #include "qdatetime.h" #include "qcoreapplication.h" #include "qthread.h" @@ -1456,9 +1457,7 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con } else if (timeFormat == QLatin1String("boot")) { // just print the milliseconds since the elapsed timer reference // like the Linux kernel does - QElapsedTimer now; - now.start(); - uint ms = now.msecsSinceReference(); + uint ms = QDeadlineTimer::current().deadline(); message.append(QString::asprintf("%6d.%03d", uint(ms / 1000), uint(ms % 1000))); #if QT_CONFIG(datestring) } else if (timeFormat.isEmpty()) { -- cgit v1.2.3