in the most recent Ubuntu distribution the QTime did not work for the ping times anymore (the ping time was always 0 ms)
This commit is contained in:
parent
d3fce3fe62
commit
715041effe
1 changed files with 7 additions and 1 deletions
|
@ -43,6 +43,8 @@ using namespace std; // because of the library: "vector"
|
|||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
# include <mmsystem.h>
|
||||
#elif !defined ( __APPLE__ ) && !defined ( __MACOSX )
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#include "ui_aboutdlgbase.h"
|
||||
|
||||
|
@ -961,8 +963,12 @@ public:
|
|||
{
|
||||
#ifdef _WIN32
|
||||
return timeGetTime();
|
||||
#else
|
||||
#elif defined ( __APPLE__ ) || defined ( __MACOSX )
|
||||
return QTime().elapsed();
|
||||
#else
|
||||
timespec tp;
|
||||
clock_gettime ( CLOCK_MONOTONIC, &tp );
|
||||
return tp.tv_nsec / 1000000; // convert ns in ms
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue