Utime to stime apache getrusage1/8/2024 Perf_counter: namespace(adjustable=False, implementation='mach_absolute_time()', monotonic=True, resolution=1e-09) Monotonic: namespace(adjustable=False, implementation='mach_absolute_time()', monotonic=True, resolution=1e-09) Time.get_clock_info(time): namespace(adjustable=True, implementation='clock_gettime(CLOCK_REALTIME)', monotonic=False, resolution=1e-09) Time.get_clock_info(thread_time): namespace(adjustable=False, implementation='clock_gettime(CLOCK_THREAD_CPUTIME_ID)', monotonic=True, resolution=1e-09) Time.get_clock_info(process_time): namespace(adjustable=False, implementation='clock_gettime(CLOCK_PROCESS_CPUTIME_ID)', monotonic=True, resolution=1e-09) Time.get_clock_info(perf_counter): namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09) Time.get_clock_info(monotonic): namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09) Time.get_clock_info(clock): namespace(adjustable=False, implementation='clock()', monotonic=True, resolution=1e-06) python -m test.pythoninfo|grep -E '^(platform|time)' > for clock in ('monotonic', 'perf_counter', 'process_time', 'thread_time', 'time'): print(f'clock: ')Ĭlock: namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09)Ĭlock: namespace(adjustable=False, implementation='clock_gettime(CLOCK_PROCESS_CPUTIME_ID)', monotonic=True, resolution=1e-09)Ĭlock: namespace(adjustable=False, implementation='clock_gettime(CLOCK_THREAD_CPUTIME_ID)', monotonic=True, resolution=1e-09)Ĭlock: namespace(adjustable=True, implementation='clock_gettime(CLOCK_REALTIME)', monotonic=False, resolution=1e-09) Thanks!Ĭan someone please give the result of these commands on Python 3.6 and 3.7 on macOS? Victor, I'd appreciate it if you could take a look at this. Since this problem has been around since 3.7.0, I am lowering the priority to "deferred blocker" to not hold up 3.7.3rc1. I've attached a WIP PR that at the moment just turns Alexander's test into a potential test case. With Python 3.6.x, that fallbacks correctly but it appears that refactoring introduced with the implementation of PEP 564 ( bpo-31784, #3989) broke that for 3.7.x (and master/3.8). For older systems, timemodule.c falls back to using getrusage. ensure the results are "close" to each other.įurther investigation shows that several time related functions were added to macOS at 10.12 including clock_gettime. I don't have time to investigate further today.īTW, it would be a good idea to adapt your test program as a test case, i.e. It looks like the incorrect results show up when building on macOS 10.11.x and earlier.ġ0.12 through 10.14 have the correct results. I had time to run a quick check building on earlier macOS versions. There were a number of changes made in 3.7 to the time module and underlying code in Python, specifically Python/pytime.c, so my guess is that the changes are depending on some feature or change that is in later versions of macOS since the expected results are obtained when built directly on and run on a current macOS version. Your test also fails when run on these earlier systems with 3.7.0 or later but not 3.6.8. The macOS Pythons from are built to run on a range of OS versions: these days macOS 10.9+ or 10.6+. There does indeed seem to be a problem but, as can be seen if you run your test from SO (please attach it to this issue!) with a current 3.6.x installer for macOS which uses the same build infrastructure as the 3.7 and 3.8 installers, the results are correct. ![]() Of course, this could introduce new problems, but also fix some old ones. To fix this problem: the build for macOS should be made with compiler Clang 10.0.0 (clang-1000.11.45.5). I asked the question on Stack Overflow today, investigated, and reported here: My Windows and Linux (CentOS) computers have no such problem. I see this problem only on my iMac (macOS Mojave, Version 10.14.3). Nitapol, lukasz.langa, miss-islington, ned.deily, rhettinger, ronaldoussoren, rvijayak, vstinnerĬreated on 02:23 by Nitapol, last changed 14:59 by admin. Python 3.7 and 3.8 process_time is not reported correctly when built on older macOS versions
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |