mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-15 07:48:15 +00:00
Added some comments on GetTime()
Reviewing GetTime() functionality
This commit is contained in:
@@ -2118,11 +2118,11 @@ static void InitTimer(void)
|
||||
previousTime = GetTime(); // Get time as double
|
||||
}
|
||||
|
||||
// Get current time measure (in seconds) since InitTimer()
|
||||
// Get elapsed time measure (in seconds)
|
||||
static double GetTime(void)
|
||||
{
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||
return glfwGetTime();
|
||||
return glfwGetTime(); // Elapsed time since glfwInit()
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
|
||||
@@ -2130,7 +2130,7 @@ static double GetTime(void)
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
uint64_t time = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec;
|
||||
|
||||
return (double)(time - baseTime)*1e-9;
|
||||
return (double)(time - baseTime)*1e-9; // Elapsed time since InitTimer()
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user