forked from qt-creator/qt-creator
StringTable: Use QElapsedTimer instead of QTime
Change-Id: I75065cbe32dcd4405360b90f3f51387f286d6186 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -28,10 +28,10 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QElapsedTimer>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QThreadPool>
|
#include <QThreadPool>
|
||||||
#include <QTime>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
using namespace CppTools::Internal;
|
using namespace CppTools::Internal;
|
||||||
@@ -139,10 +139,10 @@ void StringTablePrivate::GC()
|
|||||||
QMutexLocker locker(&m_lock);
|
QMutexLocker locker(&m_lock);
|
||||||
|
|
||||||
int initialSize = 0;
|
int initialSize = 0;
|
||||||
QTime startTime;
|
QElapsedTimer timer;
|
||||||
if (DebugStringTable) {
|
if (DebugStringTable) {
|
||||||
initialSize = m_strings.size();
|
initialSize = m_strings.size();
|
||||||
startTime = QTime::currentTime();
|
timer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect all QStrings which have refcount 1. (One reference in m_strings and nowhere else.)
|
// Collect all QStrings which have refcount 1. (One reference in m_strings and nowhere else.)
|
||||||
@@ -159,7 +159,6 @@ void StringTablePrivate::GC()
|
|||||||
if (DebugStringTable) {
|
if (DebugStringTable) {
|
||||||
const int currentSize = m_strings.size();
|
const int currentSize = m_strings.size();
|
||||||
qDebug() << "StringTable::GC removed" << initialSize - currentSize
|
qDebug() << "StringTable::GC removed" << initialSize - currentSize
|
||||||
<< "strings in" << startTime.msecsTo(QTime::currentTime())
|
<< "strings in" << timer.elapsed() << "ms, size is now" << currentSize;
|
||||||
<< "ms, size is now" << currentSize;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user