[core] Create function to retrieve frame busy time (non-sleeping time)

This commit is contained in:
Brandon Baker 2024-02-04 07:35:52 -05:00 committed by GitHub
parent c0c2e28c1b
commit beee9cee46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -1061,6 +1061,7 @@ RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get c
// Timing-related functions // Timing-related functions
RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum)
RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time) RLAPI float GetFrameTime(void); // Get time in seconds for last frame drawn (delta time)
RLAPI float GetFrameBusyTime(void); // Get the time spent actively updating and drawing a frame, excluding sleep time.
RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow() RLAPI double GetTime(void); // Get elapsed time in seconds since InitWindow()
RLAPI int GetFPS(void); // Get current FPS RLAPI int GetFPS(void); // Get current FPS

View File

@ -1633,6 +1633,13 @@ float GetFrameTime(void)
return (float)CORE.Time.frame; return (float)CORE.Time.frame;
} }
// Get the time spent actively updating and drawing a frame, excluding sleep time.
float GetFrameBusyTime(void)
{
return (float)(CORE.Time.update + CORE.Time.draw);
}
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module Functions Definition: Custom frame control // Module Functions Definition: Custom frame control
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------