path: root/src/plugins
diff options
authorMarc Mutz <>2015-10-23 16:32:59 +0200
committerMarc Mutz <>2015-10-23 18:09:18 +0000
commit2cdafb099945bd534f0c752edf8d4f1ab80ed45f (patch)
treea17e7cc311a804d920cd5f1054c6870eab6a9fae /src/plugins
parent8a8a5813a9fcbaef4dd96e8c33f605043d51b590 (diff)
Convert some QDateTime::currentDateTime() to currentDateTimeUtc() (I)
The latter is much faster as it doesn't have to deal with time zones. This change handles the trivial ones: Either the call to currentDateTime() is immediately followed by a call to toUTC() or toTime_t(). The latter is much faster on UTC QDateTimes, too. Credits to Milian Wolff, from whose QtWS15 talk this advice is taken. Change-Id: I872f5bbb26cbecedc1e5c0dbee4d5ac2c6eb67ee Reviewed-by: Milian Wolff <>
Diffstat (limited to 'src/plugins')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/bearer/qnetworksession_impl.cpp b/src/plugins/bearer/qnetworksession_impl.cpp
index 5e9e5e7015..8139040f84 100644
--- a/src/plugins/bearer/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/qnetworksession_impl.cpp
@@ -279,7 +279,7 @@ quint64 QNetworkSessionPrivateImpl::bytesReceived() const
quint64 QNetworkSessionPrivateImpl::activeTime() const
if (state == QNetworkSession::Connected && startTime != Q_UINT64_C(0))
- return QDateTime::currentDateTime().toTime_t() - startTime;
+ return QDateTime::currentDateTimeUtc().toTime_t() - startTime;
return Q_UINT64_C(0);