From 6b1541b622c767da979b467674694527e6bb3010 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Thu, 12 Jun 2014 19:28:39 +0000 Subject: [PATCH] bug fix: on Mac with newest Qt version the ping time was always 0 --- src/util.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util.h b/src/util.h index f05d68f4..35423d82 100755 --- a/src/util.h +++ b/src/util.h @@ -43,7 +43,11 @@ using namespace std; // because of the library: "vector" #ifdef _WIN32 # include # include -#elif !defined ( __APPLE__ ) && !defined ( __MACOSX ) +#elif defined ( __APPLE__ ) || defined ( __MACOSX ) +# include +# include +# include +#else # include #endif #include "ui_aboutdlgbase.h" @@ -1037,7 +1041,7 @@ public: #ifdef _WIN32 return timeGetTime(); #elif defined ( __APPLE__ ) || defined ( __MACOSX ) - return QTime().elapsed(); + return mach_absolute_time() / 1000000; // convert ns in ms #else timespec tp; clock_gettime ( CLOCK_MONOTONIC, &tp );