mirror of
https://github.com/dhewm/dhewm3.git
synced 2024-11-26 06:11:26 +00:00
Make Sys_Milliseconds() inline
it only returns Sys_MillisecondsPrecise() casted to unsigned int anyway.
This commit is contained in:
parent
b158f243b7
commit
7ac7047ddb
2 changed files with 6 additions and 13 deletions
|
@ -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 );
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue