1#ifndef INCLUDE_UTILS_DELTATIME_H_
2#define INCLUDE_UTILS_DELTATIME_H_
33 static void Init()
noexcept;
52 static std::chrono::time_point<std::chrono::high_resolution_clock>
54 static std::chrono::time_point<std::chrono::high_resolution_clock>
56 static std::chrono::time_point<std::chrono::high_resolution_clock>
Utility class for handling delta time and FPS capping.
Definition Time.h:16
static uint32_t GetTicks() noexcept
Gets the time in milliseconds since the start of the program.
Definition Time.cpp:20
static double DeltaTime() noexcept
Retrieves the time elapsed between the last two frames.
Definition Time.cpp:28
static double m_DeltaTime
Stores the delta time value in seconds.
Definition Time.h:50
static constexpr int m_TargetFPS
The target frames per second.
Definition Time.h:69
static void CapFPS()
Caps the FPS to the target frame rate.
Definition Time.cpp:44
static void Init() noexcept
Initializes the time tracking system.
Definition Time.cpp:14
static constexpr std::chrono::milliseconds m_FrameDuration
The expected duration of each frame.
Definition Time.h:70
static std::chrono::time_point< std::chrono::high_resolution_clock > m_PreviousTime
Stores the previous frame's timestamp.
Definition Time.h:53
static std::chrono::time_point< std::chrono::high_resolution_clock > m_CurrentTime
Stores the current frame's timestamp.
Definition Time.h:55
static void UpdateDeltaTime() noexcept
Updates the delta time value.
Definition Time.cpp:33
static std::chrono::time_point< std::chrono::high_resolution_clock > m_StartTime
Stores the program start timestamp.
Definition Time.h:57