1#ifndef YAZE_APP_CORE_TIMING_H
2#define YAZE_APP_CORE_TIMING_H
30 uint64_t current_time = SDL_GetPerformanceCounter();
31 float delta_time = 0.0f;
37 if (delta_time > 0.1f) {
73 uint64_t current_time = SDL_GetPerformanceCounter();
103 uint64_t current = SDL_GetPerformanceCounter();
112 constexpr float kTargetFrameTimeMs = 16.67f;
Provides accurate timing for animations and frame pacing.
void Reset()
Reset the timing state.
static TimingManager & Get()
float GetFrameBudgetRemainingMs() const
Get remaining frame budget in milliseconds (targeting 60fps)
float Update()
Update the timing manager (call once per frame)
float GetFrameElapsedMs() const
Get elapsed time within the current frame in milliseconds.
float GetDeltaTime() const
Get the last frame's delta time in seconds.
TimingManager & operator=(const TimingManager &)=delete
uint64_t frame_start_time_
float GetElapsedTime() const
Get total elapsed time since first update.
TimingManager(const TimingManager &)=delete
void BeginFrame()
Mark the start of a new frame for budget tracking.
float GetFPS() const
Get current FPS.
SDL2/SDL3 compatibility layer.