EtrediaEmpires/ECSAPI/ECS/test/benchmark.cpp
legatt 32f4597c4d Base frontend module
- Naming style migrated to camel-case
- P7lib logger sources added
- Vcpkg manifest, CMake presets and build moved to root
- SDL2, Vulkan and RmlUi dependencies added
- Logger LOG macro added
- Logger  configuration
- SDL2 window configuration
- Vulkan configuration
- RmlUi configuration
- SDL event loop
2025-08-08 00:07:32 +03:00

31 lines
660 B
C++

#include <ee_ecs/ecs.hpp>
#include "test_conf.hpp"
#include <gtest/gtest.h>
#include <chrono>
struct timer final {
timer()
: start{std::chrono::system_clock::now()} {}
void elapsed() {
auto now = std::chrono::system_clock::now();
std::cout << std::chrono::duration<double>(now - start).count() << " seconds" << std::endl;
}
private:
std::chrono::time_point<std::chrono::system_clock> start;
};
template<typename Func, typename... Args>
void genericWith(Func func) {
timer timer;
func();
timer.elapsed();
}
TEST_F(WorldBenchmark, UpdateSystems)
{
genericWith([&]() {
world.update();
});
}