Function ecs_set_target_fps


#include <include/flecs.h>

FLECS_API void ecs_set_target_fps(ecs_world_t *world, ecs_ftime_t fps)


Set target frames per second (FPS) for application. Setting the target FPS ensures that ecs_progress is not invoked faster than the specified FPS. When enabled, ecs_progress tracks the time passed since the last invocation, and sleeps the remaining time of the frame (if any).

This feature ensures systems are ran at a consistent interval, as well as conserving CPU time by not running systems more often than required.

Note that ecs_progress only sleeps if there is time left in the frame. Both time spent in flecs as time spent outside of flecs are taken into account.


world - The world.

fps - The target FPS.


Line 1454 in include/flecs.h.