Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Mefiresu committed Sep 1, 2024
1 parent d9a5045 commit 3a21dcf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion RSDKv5/RSDK/Core/ModAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,12 @@ void RSDK::UnloadMods()
SKU::userDBStorage->ClearAllUserDBs();
#endif
}

#include <chrono>
#include <iostream>
#include <fstream>
void RSDK::LoadMods(bool newOnly, bool32 getVersion)
{
std::chrono::high_resolution_clock::time_point begin = std::chrono::high_resolution_clock::now();
if (!newOnly) {
UnloadMods();

Expand Down Expand Up @@ -585,6 +588,13 @@ void RSDK::LoadMods(bool newOnly, bool32 getVersion)

SortMods();
LoadModSettings();
std::chrono::high_resolution_clock::time_point end = std::chrono::high_resolution_clock::now();
std::ofstream out("bench.txt", std::ios::app);
out << "Time LoadMods() = " << std::chrono::duration<double>(end - begin).count() << " s\n";
out << "Time LoadMods() = " << std::chrono::duration<double, std::milli>(end - begin).count() << " ms\n";
out << "Time LoadMods() = " << std::chrono::duration<double, std::micro>(end - begin).count() << " µs\n";
out << "Time LoadMods() = " << std::chrono::duration<double, std::nano> (end - begin).count() << " ns\n";
out.close();
}

void loadCfg(ModInfo *info, const std::string &path)
Expand Down

0 comments on commit 3a21dcf

Please sign in to comment.