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 kh90909
Recipients docs@python, kh90909, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2019-06-08.18:14:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The documentation for time.perf_counter() indicates it should return a system-wide value:

This is not true on Windows, as a process-specific offset is subtracted from the underlying QueryPerformanceCounter() value. The code comments indicate this is to reduce precision loss:

This is relevant in multiprocess applications, where accurate timing is required across multiple processes. Here is a simple test case:

import concurrent.futures
import time

def worker():
    return time.perf_counter()

if __name__ == '__main__':
    pool = concurrent.futures.ProcessPoolExecutor()
    futures = []
    for i in range(3):
        print('Submitting worker {:d} at time.perf_counter() == {:.3f}'.format(i, time.perf_counter()))

    for i, f in enumerate(futures):
        print('Worker {:d} started at time.perf_counter() == {:.3f}'.format(i, f.result()))

C:\...>Python37\python.exe -VV
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05)
[MSC v.1916 64 bit (AMD64)]

Submitting worker 0 at time.perf_counter() == 0.376
Submitting worker 1 at time.perf_counter() == 1.527
Submitting worker 2 at time.perf_counter() == 2.529
Worker 0 started at time.perf_counter() == 0.380
Worker 1 started at time.perf_counter() == 0.956
Worker 2 started at time.perf_counter() == 1.963

See my stackoverflow question for a comparison with Linux:
Date User Action Args
2019-06-08 18:15:00kh90909setrecipients: + kh90909, paul.moore, vstinner, tim.golden, docs@python, zach.ware, steve.dower
2019-06-08 18:15:00kh90909setmessageid: <>
2019-06-08 18:15:00kh90909linkissue37205 messages
2019-06-08 18:14:59kh90909create