I'm looking for a way to convert a Windows FILETIME
structure to a std::chrono::time_point< std::chrono::file_clock>
so that I can build a difference between two file times and express that duration f.e. in std::chrono::microseconds
.
EDIT: Here is a complete godbolt example of Howard's Answer.
Disclaimer: I don't have a Windows system to test on.
I believe that one just needs to take the high and low words of the
FILETIME
and interpret that 64 bit integral value as the number of tenths of a microsecond since thestd::chrono::file_clock
epoch:Both the units and the epoch of
FILETIME
andfile_clock
(on Windows) are identical.