Make Sys_Milliseconds() inline

it only returns Sys_MillisecondsPrecise() casted to unsigned int anyway.
This commit is contained in:
Daniel Gibson 2024-08-16 05:38:23 +02:00
parent b158f243b7
commit 7ac7047ddb
2 changed files with 6 additions and 13 deletions

View file

@ -159,13 +159,15 @@ void Sys_DebugVPrintf( const char *fmt, va_list arg );
// NOTE: due to SDL_TIMESLICE this is very bad portability karma, and should be completely removed
void Sys_Sleep( int msec );
// Sys_Milliseconds should only be used for profiling purposes,
// any game related timing information should come from event timestamps
unsigned int Sys_Milliseconds( void );
// like Sys_Milliseconds(), but with higher precision
double Sys_MillisecondsPrecise( void );
// Sys_Milliseconds should only be used for profiling purposes,
// any game related timing information should come from event timestamps
ID_INLINE unsigned int Sys_Milliseconds( void ) {
return (unsigned int)Sys_MillisecondsPrecise();
}
// sleep until Sys_MillisecondsPrecise() returns >= targetTimeMS
// aims for about 0.01ms precision (but might busy wait for the last 1.5ms or so)
void Sys_SleepUntilPrecise( double targetTimeMS );

View file

@ -68,15 +68,6 @@ void Sys_Sleep(int msec) {
SDL_Delay(msec);
}
/*
================
Sys_Milliseconds
================
*/
unsigned int Sys_Milliseconds() {
return (unsigned int)Sys_MillisecondsPrecise();
}
/*
==================
Sys_InitThreads