STINNER Victor <vstin...@python.org> added the comment:
Oh, nicely spotted Rajiv Vijayakumar and thanks for the fix! > instead of computing the total time as utime+stime, the code performs > utime+utime, which explains the doubling observed. Ooooooops, stupid me :-) I introduced the bug in: commit c29b585fd4b5a91d17fc5dd41d86edff28a30da3 Author: Victor Stinner <victor.stin...@gmail.com> Date: Thu Nov 2 07:28:27 2017 -0700 bpo-31784: Implement PEP 564: add time.time_ns() (#3989) It seems like macOS was the most visible impacted platform. Windows and Linux has different implementations (GetProcessTimes and clock_gettime(CLOCK_PROCESS_CPUTIME_ID)). Note: I wrote an article about time.perf_counter_ns() added in Python 3.7 (perf_counter, not process_time): https://vstinner.github.io/python37-perf-counter-nanoseconds.html ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36205> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com