summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qtimerinfo_unix.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-01-27 22:34:46 +0200
committerAhmad Samir <a.samirh78@gmail.com>2023-02-20 21:28:38 +0200
commitdd82f399106a66ffabdc05d55cc72d46f8bca1c7 (patch)
treec78ca0096c68031cc5d57bd4b4c33dab85049fc7 /src/corelib/kernel/qtimerinfo_unix.cpp
parent37032b15900d2ae777d83e61a521aa6a0d01836a (diff)
QtMiscUtils: add std::chrono::duration <-> timespec helpers
Change-Id: I91f36a3d651fd57443072fde4c3e8f811682328e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qtimerinfo_unix.cpp')
-rw-r--r--src/corelib/kernel/qtimerinfo_unix.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp
index 7ec23de488..2aeb7eebf0 100644
--- a/src/corelib/kernel/qtimerinfo_unix.cpp
+++ b/src/corelib/kernel/qtimerinfo_unix.cpp
@@ -9,6 +9,7 @@
#include "private/qtimerinfo_unix_p.h"
#include "private/qobject_p.h"
#include "private/qabstracteventdispatcher_p.h"
+#include <QtCore/private/qtools_p.h>
#ifdef QTIMERINFO_DEBUG
# include <QDebug>
@@ -396,8 +397,7 @@ qint64 QTimerInfoList::timerRemainingTime(int timerId)
if (currentTime < t->timeout) {
// time to wait
tm = roundToMillisecond(t->timeout - currentTime);
- using namespace std::chrono;
- const auto dur = duration_cast<milliseconds>(seconds{tm.tv_sec} + nanoseconds{tm.tv_nsec});
+ const std::chrono::milliseconds dur = QtMiscUtils::timespecToChronoMs(&tm);
return dur.count();
} else {
return 0;