mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-05 05:39:18 -05: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
|
previousTime = GetTime(); // Get time as double
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current time measure (in seconds) since InitTimer()
|
// Get elapsed time measure (in seconds)
|
||||||
static double GetTime(void)
|
static double GetTime(void)
|
||||||
{
|
{
|
||||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||||
return glfwGetTime();
|
return glfwGetTime(); // Elapsed time since glfwInit()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
|
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
|
||||||
@ -2130,7 +2130,7 @@ static double GetTime(void)
|
|||||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||||
uint64_t time = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec;
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user