summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2021-03-09 23:01:39 +0100
committerEike Ziller <eike.ziller@qt.io>2021-03-26 10:31:28 +0000
commitd3faab0e725e2fcc38b0ce22a24bd62726807f47 (patch)
tree82db2aa70e840cef40b8396a0b495e64cc56c616 /src/plugins/cpptools
parentdaf23d29a16de5c43fed59301e94688abaeb4abb (diff)
downloadqt-creator-d3faab0e725e2fcc38b0ce22a24bd62726807f47.tar.gz
StringTable: Use QElapsedTimer instead of QTime
Change-Id: I75065cbe32dcd4405360b90f3f51387f286d6186 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r--src/plugins/cpptools/stringtable.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/cpptools/stringtable.cpp b/src/plugins/cpptools/stringtable.cpp
index efd186fada..5122c3a8a9 100644
--- a/src/plugins/cpptools/stringtable.cpp
+++ b/src/plugins/cpptools/stringtable.cpp
@@ -28,10 +28,10 @@
#include <utils/qtcassert.h>
#include <QDebug>
+#include <QElapsedTimer>
#include <QMutex>
#include <QSet>
#include <QThreadPool>
-#include <QTime>
#include <QTimer>
using namespace CppTools::Internal;
@@ -139,10 +139,10 @@ void StringTablePrivate::GC()
QMutexLocker locker(&m_lock);
int initialSize = 0;
- QTime startTime;
+ QElapsedTimer timer;
if (DebugStringTable) {
initialSize = m_strings.size();
- startTime = QTime::currentTime();
+ timer.start();
}
// Collect all QStrings which have refcount 1. (One reference in m_strings and nowhere else.)
@@ -159,7 +159,6 @@ void StringTablePrivate::GC()
if (DebugStringTable) {
const int currentSize = m_strings.size();
qDebug() << "StringTable::GC removed" << initialSize - currentSize
- << "strings in" << startTime.msecsTo(QTime::currentTime())
- << "ms, size is now" << currentSize;
+ << "strings in" << timer.elapsed() << "ms, size is now" << currentSize;
}
}