system_clock::now is not entirely straight forward on Windows, which
does not have a clock_gettime function.
GetSystemTimeAsFileTime gives us the value relative to the NT epoch (Jan
1 1601) rather than the Unix epoch (Jan 1 1970). However, this function
has a low resolution (~10ms). Newer versions of Windows provide
GetSystemTimePreciseAsFileTime which gives us a much more accurate time
(<1us). Unfortunately, the latter is only available on Windows 8+ when
targeting desktop apps.
llvm-svn: 290803
The function definitions being guarded by the pragma were all static, so
they wouldn't be exported anyway. In any case, we should prefer the
visibility macros. No functional change.
Differential Revision: https://reviews.llvm.org/D26940
llvm-svn: 287768
The system_clock::now() function currently uses gettimeofday(). The
problem with gettimeofday() is that it is an obsolete XSI function,
hence unavailable on CloudABI. See:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html
Change this code to use clock_gettime() with CLOCK_REALTIME instead,
which is more consistent, as clock_gettime() is already used for
steady_clock.
A previous version of this change actually attempted to change
system_clock::duration, but I reverted this part as it breaks the
existing ABI.
Differential Revision: http://reviews.llvm.org/D8253
Approved by: jroelofs
llvm-svn: 237390