Commit 5940fd31 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55479 954022d7-b5bf-4e40-9824-e11837661b57
parent de567b04
......@@ -11,6 +11,22 @@
namespace NSTimers
{
#ifdef _MAC
static DWORD getUptimeInMilliseconds()
{
const int64_t kOneMillion = 1000 * 1000;
static mach_timebase_info_data_t s_timebase_info;
if (s_timebase_info.denom == 0) {
(void) mach_timebase_info(&s_timebase_info);
}
// mach_absolute_time() returns billionth of seconds,
// so divide by one million to get milliseconds
return (DWORD)((mach_absolute_time() * s_timebase_info.numer) / (kOneMillion * s_timebase_info.denom));
}
#endif
static DWORD GetTickCount()
{
#if defined(WIN32) || defined(_WIN32_WCE)
......@@ -22,8 +38,9 @@ namespace NSTimers
return (ts.tv_sec * 1000 + (DWORD)(ts.tv_nsec / 1000000));
#else
uint64_t nano = mach_absolute_time();
return nano / 1000000;
//uint64_t nano = mach_absolute_time();
//return nano / 1000000;
return getUptimeInMilliseconds();
#endif
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment