mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-29 18:32:36 +00:00
Log content files loading time by editor
This commit is contained in:
parent
8a6a3c7121
commit
de24cdc12c
@ -8,6 +8,7 @@
|
||||
#include <apps/opencs/model/world/data.hpp>
|
||||
#include <apps/opencs/model/world/universalid.hpp>
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
#include <components/files/conversion.hpp>
|
||||
|
||||
#include <QTimer>
|
||||
@ -56,6 +57,9 @@ void CSMDoc::Loader::load()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mStart.has_value())
|
||||
mStart = std::chrono::steady_clock::now();
|
||||
|
||||
std::vector<std::pair<Document*, Stage>>::iterator iter = mDocuments.begin();
|
||||
|
||||
Document* document = iter->first;
|
||||
@ -133,6 +137,14 @@ void CSMDoc::Loader::load()
|
||||
|
||||
if (done)
|
||||
{
|
||||
if (mStart.has_value())
|
||||
{
|
||||
const auto duration = std::chrono::steady_clock::now() - *mStart;
|
||||
Log(Debug::Verbose) << "Loaded content files in "
|
||||
<< std::chrono::duration_cast<std::chrono::duration<double>>(duration).count() << 's';
|
||||
mStart.reset();
|
||||
}
|
||||
|
||||
mDocuments.erase(iter);
|
||||
emit documentLoaded(document);
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef CSM_DOC_LOADER_H
|
||||
#define CSM_DOC_LOADER_H
|
||||
|
||||
#include <chrono>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -35,6 +37,8 @@ namespace CSMDoc
|
||||
QTimer* mTimer;
|
||||
bool mShouldStop;
|
||||
|
||||
std::optional<std::chrono::steady_clock::time_point> mStart;
|
||||
|
||||
public:
|
||||
Loader();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user