/* ================= Com_GetEvent ================= */ sysEvent_t Com_GetEvent( void ) { if ( com_pushedEventsHead > com_pushedEventsTail ) { com_pushedEventsTail++; return com_pushedEvents[ (com_pushedEventsTail-1) & (MAX_PUSHED_EVENTS-1) ]; } return Com_GetRealEvent(); }
/* ================ Com_Milliseconds Can be used for profiling, but will be journaled accurately ================ */ int Com_Milliseconds (void) { sysEvent_t ev; // get events and push them until we get a null event with the current time do { ev = Com_GetRealEvent(); if ( ev.evType != SE_NONE ) { Com_PushEvent( &ev ); } } while ( ev.evType != SE_NONE ); return ev.evTime; }
/* ================ idEventLoop::Milliseconds Can be used for profiling, but will be journaled accurately ================ */ int idEventLoop::Milliseconds( void ) { #if 1 // FIXME! return Sys_Milliseconds() - initialTimeOffset; #else sysEvent_t ev; // get events and push them until we get a null event with the current time do { ev = Com_GetRealEvent(); if ( ev.evType != SE_NONE ) { Com_PushEvent( &ev ); } } while ( ev.evType != SE_NONE ); return ev.evTime; #endif }