Skip to content

Commit

Permalink
speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mefiresu committed Sep 1, 2024
1 parent 5b29585 commit ff39f08
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions RSDKv5/RSDK/Core/ModAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,8 @@ void RSDK::UnloadMods()
SKU::userDBStorage->ClearAllUserDBs();
#endif
}
#include <string>
#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();
Expand Down Expand Up @@ -589,12 +588,12 @@ 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();
std::string toto;
toto.append("Time LoadMods() = " + std::to_string(std::chrono::duration<double>(end - begin).count()) + " s\n");
toto.append("Time LoadMods() = " + std::to_string(std::chrono::duration<double, std::milli>(end - begin).count()) + " ms\n");
toto.append("Time LoadMods() = " + std::to_string(std::chrono::duration<double, std::micro>(end - begin).count()) + " µs\n");
toto.append("Time LoadMods() = " + std::to_string(std::chrono::duration<double, std::nano> (end - begin).count()) + " ns\n");
PrintLog(PRINT_NORMAL, "%s", toto.c_str());
}

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

0 comments on commit ff39f08

Please sign in to comment.