Skip to content

Commit

Permalink
[1.8>1.9] [MERGE #4593 @obastemur] osx: use clock_gettime when it's a…
Browse files Browse the repository at this point in the history
…vailable

Merge pull request #4593 from obastemur:use_clock_gettime_osx

Recent OSX distros have clock_gettime support. Use it when it's available (~3 times faster to what we do to replace that)
  • Loading branch information
obastemur committed Jan 23, 2018
2 parents 14831da + 984f870 commit 3f2f8a7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace DateTime
// This method is expected to return UTC time (See MSDN GetSystemTime)
inline static double GetSystemTimeREAL()
{
#ifndef __APPLE__
#ifdef HAVE_WORKING_CLOCK_GETTIME
struct timespec fast_time;
// method below returns UTC time. So, nothing else is needed
// we use clock_gettime first due to expectation of better accuracy
Expand Down

0 comments on commit 3f2f8a7

Please sign in to comment.