diff --git a/src/raylib.h b/src/raylib.h index 7cf4e6536..0240beab4 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1061,6 +1061,7 @@ RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Get c // Timing-related functions 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 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 int GetFPS(void); // Get current FPS diff --git a/src/rcore.c b/src/rcore.c index 48c863f56..eaf61ed68 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -1633,6 +1633,13 @@ float GetFrameTime(void) 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 //----------------------------------------------------------------------------------