-}
-
-double Sys_DoubleTime (void)
-{
- static int first = true;
- static double oldtime = 0.0, curtime = 0.0;
- double newtime;
- if(sys_usenoclockbutbenchmark.integer)
- {
- benchmark_time += 1;
- return ((double) benchmark_time) / 1e6;
- }
- // use higher precision timers on some platforms
-#ifndef WIN32
-# ifndef MACOSX
- if (sys_useclockgettime.integer)
- {
- struct timespec ts;
-# ifdef SUNOS
- clock_gettime(CLOCK_HIGHRES, &ts);
-# else
- clock_gettime(CLOCK_MONOTONIC, &ts);
-# endif
- newtime = (double) ts.tv_sec + ts.tv_nsec / 1000000000.0;
- }
- else if (sys_usegettimeofday.integer)
-# endif
- {
- struct timeval tp;
- gettimeofday(&tp, NULL);
- newtime = (double) tp.tv_sec + tp.tv_usec / 1000000.0;
- }
- else