diff options
| author | jtainer <[email protected]> | 2022-11-28 18:46:10 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-11-29 00:46:10 +0100 |
| commit | 50a716c0d91f90e73f1fe2b910b3f7426a0d1360 (patch) | |
| tree | 0e29c2516868ee17fb3ae6b7bdcaa81fd78588cb /src | |
| parent | 57bd84510fee9515788361b39ec4f3e3fb2cbaea (diff) | |
| download | raylib-50a716c0d91f90e73f1fe2b910b3f7426a0d1360.tar.gz raylib-50a716c0d91f90e73f1fe2b910b3f7426a0d1360.zip | |
Updated rcore.c, renamed 'time' to 'nanoSeconds' (#2816)
* Updated rcore.c, renamed 'time' to 'time_nsec'
When PLATFORM_ANDROID, PLATFORM_RPI or PLATFORM_DRM were defined, there is a compilation error to redefinition of the variable 'time', so the second instance of 'time' was changed to 'time_nsec' which both fixes the name collision and more accurately describes what that variable represents.
* Renamed 'time_nsec' to 'nanoSeconds'
Diffstat (limited to 'src')
| -rw-r--r-- | src/rcore.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rcore.c b/src/rcore.c index 0f47420b..8f5b63b1 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2763,9 +2763,9 @@ double GetTime(void) #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM) struct timespec ts = { 0 }; clock_gettime(CLOCK_MONOTONIC, &ts); - unsigned long long int time = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec; + unsigned long long int nanoSeconds = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec; - time = (double)(time - CORE.Time.base)*1e-9; // Elapsed time since InitTimer() + time = (double)(nanoSeconds - CORE.Time.base)*1e-9; // Elapsed time since InitTimer() #endif return time; } |
