diff options
author | you <ovvv@web.de> | 2018-03-24 00:31:33 +0100 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2018-03-24 00:31:33 +0100 |
commit | bcd22fc34cf70c3fe246f500633aa42e388fabc4 (patch) | |
tree | d6dfdc9f901fd7e5a031f2af150ecd25acd6a648 /src/server | |
parent | eab652fd52b7b806b9414a26a0bf5348df4282f6 (diff) | |
download | minetest-bcd22fc34cf70c3fe246f500633aa42e388fabc4.tar.gz minetest-bcd22fc34cf70c3fe246f500633aa42e388fabc4.tar.bz2 minetest-bcd22fc34cf70c3fe246f500633aa42e388fabc4.zip |
Print the mod loading time (#7137)
* Print the mod loading time
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/mods.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/mods.cpp b/src/server/mods.cpp index 778241b95..34ac760e4 100644 --- a/src/server/mods.cpp +++ b/src/server/mods.cpp @@ -47,6 +47,7 @@ ServerModManager::ServerModManager(const std::string &worldpath) : addModsFromConfig(worldmt, gamespec.addon_mods_paths); } +// clang-format off // This function cannot be currenctly easily tested but it should be ASAP void ServerModManager::loadMods(ServerScripting *script) { @@ -66,11 +67,17 @@ void ServerModManager::loadMods(ServerScripting *script) } std::string script_path = mod.path + DIR_DELIM + "init.lua"; infostream << " [" << padStringRight(mod.name, 12) << "] [\"" - << script_path << "\"]" << std::endl; + << script_path << "\"]" << std::endl; + auto t = std::chrono::steady_clock::now(); script->loadMod(script_path, mod.name); + infostream << "Mod \"" << mod.name << "\" loaded after " + << std::chrono::duration_cast<std::chrono::milliseconds>( + std::chrono::steady_clock::now() - t).count() * 0.001f + << " seconds" << std::endl; } } +// clang-format on const ModSpec *ServerModManager::getModSpec(const std::string &modname) const { std::vector<ModSpec>::const_iterator it; |