Add Stopwatch for accurate duration measuring
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include "Internal/StdTypesContainer.h"
|
||||
#include "Engine/Core/ObjectsRemovalService.h"
|
||||
#include "Engine/Core/Types/TimeSpan.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
#include "Engine/Core/Types/Stopwatch.h"
|
||||
#include "Engine/Content/Asset.h"
|
||||
#include "Engine/Content/Content.h"
|
||||
#include "Engine/Engine/EngineService.h"
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "Engine/Engine/Time.h"
|
||||
#include "Engine/Graphics/RenderTask.h"
|
||||
#include "Engine/Serialization/JsonTools.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
|
||||
extern void registerFlaxEngineInternalCalls();
|
||||
|
||||
@@ -126,7 +127,7 @@ void onEngineUnloading(MAssembly* assembly);
|
||||
|
||||
bool ScriptingService::Init()
|
||||
{
|
||||
const auto startTime = DateTime::NowUTC();
|
||||
Stopwatch stopwatch;
|
||||
|
||||
// Initialize managed runtime
|
||||
if (MCore::LoadEngine())
|
||||
@@ -158,9 +159,8 @@ bool ScriptingService::Init()
|
||||
return true;
|
||||
}
|
||||
|
||||
auto endTime = DateTime::NowUTC();
|
||||
LOG(Info, "Scripting Engine initializated! (time: {0}ms)", (int32)((endTime - startTime).GetTotalMilliseconds()));
|
||||
|
||||
stopwatch.Stop();
|
||||
LOG(Info, "Scripting Engine initializated! (time: {0}ms)", stopwatch.GetMilliseconds());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ bool Scripting::LoadBinaryModules(const String& path, const String& projectFolde
|
||||
if (!module)
|
||||
{
|
||||
// Load library
|
||||
const auto startTime = DateTime::NowUTC();
|
||||
Stopwatch stopwatch;
|
||||
#if PLATFORM_ANDROID || PLATFORM_MAC
|
||||
// On some platforms all native binaries are side-by-side with the app in a different folder
|
||||
if (!FileSystem::FileExists(nativePath))
|
||||
@@ -390,8 +390,8 @@ bool Scripting::LoadBinaryModules(const String& path, const String& projectFolde
|
||||
LOG(Error, "Failed to setup library '{0}' for binary module {1}.", nativePath, name);
|
||||
return true;
|
||||
}
|
||||
const auto endTime = DateTime::NowUTC();
|
||||
LOG(Info, "Module {0} loaded in {1}ms", name, (int32)(endTime - startTime).GetTotalMilliseconds());
|
||||
stopwatch.Stop();
|
||||
LOG(Info, "Module {0} loaded in {1}ms", name, stopwatch.GetMilliseconds());
|
||||
|
||||
// Get the binary module
|
||||
module = getBinaryFunc();
|
||||
|
||||
Reference in New Issue
Block a user