git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55275 954022d7-b5bf-4e40-9824-e11837661b57

This commit is contained in:
Oleg.Korshul
2014-03-31 10:26:01 +00:00
committed by Alexander Trofimov
parent ff4c5f9ccf
commit 5b264dd685
8 changed files with 62 additions and 42 deletions

View File

@ -3,6 +3,11 @@
#include "BaseThread.h"
#ifdef QT_MAC
#include "mach/mach.h"
#include "mach/mach_time.h"
#endif
namespace NSTimers
{
static DWORD GetTickCount()
@ -10,10 +15,15 @@ namespace NSTimers
#if defined(WIN32) || defined(_WIN32_WCE)
return ::GetTickCount();
#else
#ifdef CLOCK_MONOTONIC
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (ts.tv_sec * 1000 + (DWORD)(ts.tv_nsec / 1000000));
#else
uint64_t nano = mach_absolute_time();
return nano / 1000000;
#endif
#endif
}
@ -72,4 +82,4 @@ namespace NSTimers
};
}
#endif
#endif