From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 573CB3858C31; Fri, 8 Mar 2024 10:21:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 573CB3858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709893269; bh=a31z7YpmXigUKYIFJh4QgYaFvZZ2DSwL2Iea6GO/5e4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=v2nI+B01f2194aPtyxiYgr7puyXSnqc3DprFLxFirOUFB0DSWwnjV7l5OO44OTaqB N2zTaKrhCnm8JCnLkWgpDBknva/m3Qi+jAXD7MUUw0cBxh7vCb+iTd3gaCZRQ/BsG6 9qHP7Yt8LqJfBJHNWRQM1LtdjgIMogbO4aw3F4Ws= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/63400] [C++11]precision of std::chrono::high_resolution_clock Date: Fri, 08 Mar 2024 10:21:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D63400 --- Comment #10 from Jonathan Wakely --- GetSystemTimePreciseAsFileTime gives UTC, so would need adjustment for leap seconds to turn it into a sys_time. That's doable though. Alternatively, we could use it to implement a high performance chrono::utc_clock, and then define system_clock::now() in terms of that. The standard specifies utc_clock::now() as: "Returns: from_sys(system_clock::now()), or a more accurate value of utc_ti= me." 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_c= lock for Windows.=