Skip to content
Commit 6e3a0cc4 authored by Saleem Abdulrasool's avatar Saleem Abdulrasool
Browse files

chrono: implement a Windows version of system_clock::now

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
parent 581bb5b9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment