]> de.git.xonotic.org Git - xonotic/d0_blind_id.git/blobdiff - main.c
don't use clock_gettime, OS X sucks
[xonotic/d0_blind_id.git] / main.c
diff --git a/main.c b/main.c
index 3c233e8e5a7fed2068b69ae882da1df082daeb06..1a649a20e6bb775b66113d0266f42103a58cab70 100644 (file)
--- a/main.c
+++ b/main.c
@@ -25,12 +25,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 void bench(double *b)
 {
-       static struct timespec thistime, lasttime;
+       static struct timeval thistime, lasttime;
        static double x = 0;
        static double *lastclock = &x;
        lasttime = thistime;
-       clock_gettime(CLOCK_MONOTONIC, &thistime);
-       *lastclock += (thistime.tv_sec - lasttime.tv_sec) + 0.000000001 * (thistime.tv_nsec - lasttime.tv_nsec);
+       gettimeofday(&thistime, NULL);
+       *lastclock += (thistime.tv_sec - lasttime.tv_sec) + 0.000001 * (thistime.tv_usec - lasttime.tv_usec);
        lastclock = b;
 }