mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-30 21:32:42 +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/data.hpp>
|
||||||
#include <apps/opencs/model/world/universalid.hpp>
|
#include <apps/opencs/model/world/universalid.hpp>
|
||||||
|
|
||||||
|
#include <components/debug/debuglog.hpp>
|
||||||
#include <components/files/conversion.hpp>
|
#include <components/files/conversion.hpp>
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@ -56,6 +57,9 @@ void CSMDoc::Loader::load()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mStart.has_value())
|
||||||
|
mStart = std::chrono::steady_clock::now();
|
||||||
|
|
||||||
std::vector<std::pair<Document*, Stage>>::iterator iter = mDocuments.begin();
|
std::vector<std::pair<Document*, Stage>>::iterator iter = mDocuments.begin();
|
||||||
|
|
||||||
Document* document = iter->first;
|
Document* document = iter->first;
|
||||||
@ -133,6 +137,14 @@ void CSMDoc::Loader::load()
|
|||||||
|
|
||||||
if (done)
|
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);
|
mDocuments.erase(iter);
|
||||||
emit documentLoaded(document);
|
emit documentLoaded(document);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#ifndef CSM_DOC_LOADER_H
|
#ifndef CSM_DOC_LOADER_H
|
||||||
#define CSM_DOC_LOADER_H
|
#define CSM_DOC_LOADER_H
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -35,6 +37,8 @@ namespace CSMDoc
|
|||||||
QTimer* mTimer;
|
QTimer* mTimer;
|
||||||
bool mShouldStop;
|
bool mShouldStop;
|
||||||
|
|
||||||
|
std::optional<std::chrono::steady_clock::time_point> mStart;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Loader();
|
Loader();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user