forked from qt-creator/qt-creator
ClangTools: Print elapsed time on finish
...as this is useful to know for some bigger runs. Change-Id: Ib4cc68ea4a3bed21ac7e632213e92e26be03d978 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -326,6 +326,7 @@ void ClangToolRunWorker::start()
|
||||
}
|
||||
|
||||
reportStarted();
|
||||
m_elapsed.start();
|
||||
|
||||
while (m_runners.size() < parallelRuns && !m_queue.isEmpty())
|
||||
analyzeNextFile();
|
||||
@@ -343,6 +344,13 @@ void ClangToolRunWorker::stop()
|
||||
m_progress.reportFinished();
|
||||
|
||||
reportStopped();
|
||||
|
||||
// Print elapsed time since start
|
||||
const QTime format = QTime(0, 0, 0, 0).addMSecs(m_elapsed.elapsed() + 500);
|
||||
QString time = format.toString("h:mm:ss");
|
||||
if (time.startsWith("0:"))
|
||||
time.remove(0, 2); // Don't display zero hours
|
||||
appendMessage(tr("Elapsed time: %1.") .arg(time), NormalMessageFormat);
|
||||
}
|
||||
|
||||
void ClangToolRunWorker::analyzeNextFile()
|
||||
|
||||
Reference in New Issue
Block a user