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 eryksun
Recipients akira, belopolsky, eryksun, lemburg, pitrou, steve.dower, tim.golden, tim.peters, vstinner, zach.ware
Date 2021-06-13.22:48:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> What are the expected benefits from changing? Just a higher 
> resolution? I'm not sure that's worth anything if it's inaccurate.

GetSystemTimePreciseAsFileTime() returns an accurate timestamp, which is the current system time plus the difference between the current value of the performance counter and its value when the system time was last updated. This can't be replicated simply with separate calls to GetSystemTimeAsFileTime() and QueryPerformanceCounter(). It relies on the following undocumented fields in the KUSER_SHARED_DATA record: BaselineSystemTimeQpc, QpcSystemTimeIncrement, and QpcSystemTimeIncrementShift. 

The system uses a similar procedure in QueryInterruptTimePrecise() to extend the precision of QueryInterruptTime(). Ditto for QueryUnbiasedInterruptTime() vs QueryUnbiasedInterruptTimePrecise().

> "GetSystemTimePreciseAsFileTime() has very little overhead; the new 
> function is even a little faster than GetSystemTimeAsFileTime(), a 
> call takes a few ten nanoseconds."

The above claim was corrected back in 2014. GetSystemTimePreciseAsFileTime() is considerably more expensive than GetSystemTimeAsFileTime(). It costs about 10 times more on a system that supports an invariant TSC. It would be more expensive on an older system that use the chipset's HPET or ACPI PM timer. That said, I doubt this matters very much when calling time.time() in interpreted code. It's a difference measured in tens of nanoseconds.
Date User Action Args
2021-06-13 22:48:09eryksunsetrecipients: + eryksun, lemburg, tim.peters, belopolsky, pitrou, vstinner, tim.golden, akira, zach.ware, steve.dower
2021-06-13 22:48:09eryksunsetmessageid: <>
2021-06-13 22:48:09eryksunlinkissue19007 messages
2021-06-13 22:48:08eryksuncreate