diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 04468d7aac2..748ca606618 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()) {