summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-05-22 12:07:28 -0700
committerThiago Macieira <thiago.macieira@intel.com>2020-12-09 12:55:21 -0700
commitaf520c8ef32aef67b4e06c60c4fdb49338afeb38 (patch)
treeccd0c054dc41c17cfcdd3eea29bf13b64e45a1b7 /src
parentc000143ee472fc613b91a4f16f321509e4f0ee18 (diff)
Use QDeadlineTimer in qlogging.cpp
No change, just shorter code. Change-Id: I25d85d86649448d5b2b3fffd1450f95b0ec66927 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qlogging.cpp5
1 files changed, 2 insertions, 3 deletions
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()) {