aboutsummaryrefslogtreecommitdiff
path: root/src/test/Profiling.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-10 19:50:26 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-10 19:50:26 +0100
commit770496ee9d0e45480c0e0f8951adb8eee247bfe1 (patch)
tree98c68b0d37d8a1c0c8b8013ea7884d56f04aaa28 /src/test/Profiling.cpp
parent0cb7f2f82ca167656b3c5cb9f0cc3b44c59cb0eb (diff)
big WIP
Diffstat (limited to 'src/test/Profiling.cpp')
-rw-r--r--src/test/Profiling.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/Profiling.cpp b/src/test/Profiling.cpp
index c753bca..3f48ced 100644
--- a/src/test/Profiling.cpp
+++ b/src/test/Profiling.cpp
@@ -36,7 +36,7 @@ class TestScript : public Script {
subscribe<CollisionEvent>(
[this](const CollisionEvent & ev) -> bool { return this->oncollision(ev); });
}
- void update() {
+ void fixed_update() {
// Retrieve component from the same GameObject this script is on
}
};
@@ -77,9 +77,9 @@ public:
});
// initialize systems here:
//calls init
- script_sys.update();
+ script_sys.fixed_update();
//creates window
- render_sys.update();
+ render_sys.frame_update();
}
// Helper function to time an update call and store its duration
@@ -97,12 +97,12 @@ public:
// Run and profile all systems, return the total time in milliseconds
std::chrono::microseconds run_all_systems() {
std::chrono::microseconds total_microseconds = 0us;
- total_microseconds += time_function("PhysicsSystem", [&]() { physics_sys.update(); });
+ total_microseconds += time_function("PhysicsSystem", [&]() { physics_sys.fixed_update(); });
total_microseconds
- += time_function("CollisionSystem", [&]() { collision_sys.update(); });
+ += time_function("CollisionSystem", [&]() { collision_sys.fixed_update(); });
total_microseconds
- += time_function("ParticleSystem", [&]() { particle_sys.update(); });
- total_microseconds += time_function("RenderSystem", [&]() { render_sys.update(); });
+ += time_function("ParticleSystem", [&]() { particle_sys.fixed_update(); });
+ total_microseconds += time_function("RenderSystem", [&]() { render_sys.frame_update(); });
return total_microseconds;
}
@@ -227,7 +227,7 @@ TEST_F(DISABLED_ProfilingTest, Profiling_3) {
.sprite = test_sprite,
});
}
- render_sys.update();
+ render_sys.frame_update();
this->game_object_count++;
this->total_time = 0us;