ok?

Index: glxgears.c
===================================================================
RCS file: /cvs/xenocara/app/glxgears/glxgears.c,v
retrieving revision 1.2
diff -u -p -r1.2 glxgears.c
--- glxgears.c  13 Jul 2014 09:47:57 -0000      1.2
+++ glxgears.c  26 Oct 2019 17:36:30 -0000
@@ -42,11 +42,6 @@
 typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
 #endif
 
-
-#define BENCHMARK
-
-#ifdef BENCHMARK
-
 /* XXX this probably isn't very portable */
 
 #include <sys/time.h>
@@ -56,34 +51,16 @@ typedef int (*PFNGLXGETSWAPINTERVALMESAP
 static double
 current_time(void)
 {
-   struct timeval tv;
-#ifdef __VMS
-   (void) gettimeofday(&tv, NULL );
+#ifdef CLOCK_MONOTONIC
+   struct timespec ts;
+   (void) clock_gettime(CLOCK_MONOTONIC, &ts);
+   return ts.tv_sec + ts.tv_nsec / 1000000000.0;
 #else
-   struct timezone tz;
-   (void) gettimeofday(&tv, &tz);
+   struct timeval tv;
+   (void) gettimeofday(&tv, NULL);
+   return tv.tv_sec + tv.tv_usec / 1000000.0;
 #endif
-   return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
 }
-
-#else /*BENCHMARK*/
-
-/* dummy */
-static double
-current_time(void)
-{
-   /* update this function for other platforms! */
-   static double t = 0.0;
-   static int warn = 1;
-   if (warn) {
-      fprintf(stderr, "Warning: current_time() not implemented!!\n");
-      warn = 0;
-   }
-   return t += 1.0;
-}
-
-#endif /*BENCHMARK*/
-
 
 
 #ifndef M_PI

Reply via email to