https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63400

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #10)
> GetSystemTimePreciseAsFileTime gives UTC, so would need adjustment for leap
> seconds to turn it into a sys_time. That's doable though.

Doable, but it would make calls to system_clock::now() slower, because
converting UTC to system requires a lookup in the leap second table, and then
adjusting the time.

Another option would be to leave system_clock alone, but make utc_clock fast
and precise on Windows, and make high_resolution_clock a separate type (not a
typedef for system_clock) which happens to use the same implementation as
utc_clock.

> Also, if Windows FILETIME is measured in UTC then chrono::file_clock should
> use that too. So we might want to use a custom implementation of
> chrono::file_clock for Windows.

And replace its from_sys/to_sys members with from_utc/to_utc.

Reply via email to