15 #include <SDL_timer.h> 
   26 #define THREADED        // to use the proper set of macros 
   31 static longlong Timer_last_value = 0, Timer_base = 0, Timer_freq = 0;
 
   35 static longlong Timer_perf_counter_base = 0;    
 
   36 static longlong Timer_perf_counter_freq = 0;    
 
   38 static int Timer_inited = 0;
 
   42 #define MICROSECONDS_PER_SECOND 1000000 
   57         if ( !Timer_inited )    {
 
   62                 Timer_base = Timer_last_value = timeGetTime();
 
   67                 Timer_perf_counter_base = perf_start_time.
QuadPart;
 
   71                 QueryPerformanceFrequency(&perf_frequency);
 
   72                 Timer_perf_counter_freq = perf_frequency.
QuadPart;
 
   77                 gettimeofday(&time_value, NULL);
 
   82                 Timer_perf_counter_freq = 1;
 
   91 static uint timer_get()
 
   98         time_now = timeGetTime();
 
  100         if ( time_now < Timer_last_value ) {
 
  102                 Timer_base = time_now;
 
  106         Timer_last_value = time_now;
 
  110         return (
uint)(time_now - Timer_base);
 
  112         return SDL_GetTicks();
 
  127         return (
fix)(a / 1000);
 
  147         return (timer_get() / 1000);
 
  167         return timer_get() * 1000;
 
  172         if ( !Timer_inited ) {
 
  190         gettimeofday(&time_value, NULL);
 
  203         timestamp_ticker = 2;
 
  210 #define MAX_TIME (INT_MAX/2) 
  214         timestamp_ticker += frametime_ms;
 
  216         if ( timestamp_ticker > 
MAX_TIME )      {
 
  217                 timestamp_ticker = 2;           
 
  220         if (timestamp_ticker < 2 ) {
 
  221                 mprintf((
"Whoa!!!  timestamp_ticker < 2 -- resetting to 2!!!\n"));
 
  222                 timestamp_ticker = 2;
 
  229         if (delta_ms < 0 ) 
return 0;
 
  230         if (delta_ms == 0 ) 
return 1;
 
  231         t2 = timestamp_ticker + delta_ms;
 
  280         if (t <= timestamp_ticker)
 
int timestamp(int delta_ms)
 
#define DELETE_CRITICAL_SECTION(csc)
 
#define MICROSECONDS_PER_SECOND
 
int timer_get_microseconds()
 
bool QueryPerformanceCounter(LARGE_INTEGER *pcount)
 
SDL_mutex * CRITICAL_SECTION
 
char stamp[STAMP_STRING_LENGTH]
 
fix timer_get_approx_seconds()
 
uint timer_get_high_res_microseconds()
 
int timestamp_until(int stamp)
 
GLboolean GLboolean GLboolean GLboolean a
 
#define ENTER_CRITICAL_SECTION(csc)
 
GLenum GLint GLint * precision
 
fix timer_get_fixed_secondsX()
 
#define LEAVE_CRITICAL_SECTION(csc)
 
fix timer_get_fixed_seconds()
 
#define INITIALIZE_CRITICAL_SECTION(csc)
 
int timestamp_has_time_elapsed(int stamp, int time)
 
void timestamp_inc(int frametime_ms)
 
int timer_get_milliseconds()