This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lunixbochs2
Recipients eryksun, lunixbochs2, paul.moore, steve.dower, tim.golden, zach.ware
Date 2021-06-09.23:13:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623280439.95.0.402122813697.issue44328@roundup.psfhosted.org>
In-reply-to
Content
Great information, thanks!

> Windows 10 also provides QueryInterruptTimePrecise(), which is a hybrid solution. It uses the performance counter to interpolate a timestamp between interrupts. I'd prefer to use this for time.monotonic() instead of QPC, if it's available via GetProcAddress()

My personal vote is to use the currently most common clock source (QPC) for now for monotonic(), because it's the same across Windows versions and the most likely to produce portable monotonic timestamps between apps/languages on the same system. It's also the easiest patch, as there's already a code path for QPC.

(As someone building multi-app experiences around Python, I don't want to check the Windows version to see which time base Python is using. I'd feel better about switching to QITP() if/when Python drops Windows 8 support.)

A later extension of this idea (maybe behind a PEP) could be to survey the existing timers available on each platform and consider whether it's worth extending `time` to expose them all, and unify cross-platform the ones that are exposed (e.g. better formalize/document which clocks will advance while the machine is asleep on each platform).
History
Date User Action Args
2021-06-09 23:13:59lunixbochs2setrecipients: + lunixbochs2, paul.moore, tim.golden, zach.ware, eryksun, steve.dower
2021-06-09 23:13:59lunixbochs2setmessageid: <1623280439.95.0.402122813697.issue44328@roundup.psfhosted.org>
2021-06-09 23:13:59lunixbochs2linkissue44328 messages
2021-06-09 23:13:59lunixbochs2create