Measure how long reading the header file takes

This commit is contained in:
Jan 2021-02-14 10:46:29 +01:00
parent b25d64e5e7
commit cef9b08efb

View File

@ -1,5 +1,7 @@
#include "HeaderFileReader.h"
#include <chrono>
#include <iostream>
#include "Impl/HeaderLexer.h"
@ -62,5 +64,10 @@ bool HeaderFileReader::ReadHeaderFile(IDataRepository* repository)
const auto lexer = std::make_unique<HeaderLexer>(m_stream);
const auto parser = std::make_unique<HeaderParser>(lexer.get(), repository);
return parser->Parse();
const auto start = std::chrono::steady_clock::now();
const auto result = parser->Parse();
const auto end = std::chrono::steady_clock::now();
std::cout << "Processing header took " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms" << std::endl;
return result;
}