
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2019-01-10 07:43 byrfmoz, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11503 | merged | nanjekyejoannah,2019-01-10 13:56 | |
| PR 11503 | merged | nanjekyejoannah,2019-01-10 13:56 | |
| PR 11503 | merged | nanjekyejoannah,2019-01-10 13:56 | |
| Messages (6) | |||
|---|---|---|---|
| msg333366 -(view) | Author: Ricardo Fraile (rfmoz) | Date: 2019-01-10 07:43 | |
Finally since the release of OSX 10.12 the equivalent from the FreeBSD and OpenBSD "CLOCK_UPTIME" is available on Darwin under the name "CLOCK_UPTIME_RAW":CLOCK_UPTIME FreeBSD [1]:Starts at zero when the kernel boots and increments monotonically in SI seconds while the machine is running.CLOCK_UPTIME OpenBSD [2]:Time whose absolute value is the time the system has been running and not suspended, providing accurate uptime measurement, both absolute and intervalCLOCK_UPTIME_RAW Darwin [3]:Clock that increments monotonically, tracking the time since an arbitrary point, unaffected by frequency or time adjustments and not increment while the system is asleep.It would be useful to have it available on time module [4] for this platform.As the behaviour is equivalent, maybe it can be assigned to the existing time.CLOCK_UPTIME funtion.Thanks,[1] -https://www.freebsd.org/cgi/man.cgi?query=clock_gettime[2] -https://man.openbsd.org/clock_gettime.2[3] -http://www.manpagez.com/man/3/clock_gettime_nsec_np/[4] -https://docs.python.org/3/library/time.htm | |||
| msg333376 -(view) | Author: Joannah Nanjekye (nanjekyejoannah)*![]() | Date: 2019-01-10 12:33 | |
I am working on this. | |||
| msg333381 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-01-10 14:23 | |
> As the behaviour is equivalent, maybe it can be assigned to the existing time.CLOCK_UPTIME funtion.Nah, in Python we map directly to OS constant and don't try to be smart. It's up to the user of these constants to make their own choice.Use Python functions for portable behavior: time.monotonic(), time.perf_counter(), etc. | |||
| msg333406 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-01-10 16:56 | |
New changeset572168a016ece1b7346695eb7289190c46f1ae55 by Victor Stinner (Joannah Nanjekye) in branch 'master':bpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (GH-11503)https://github.com/python/cpython/commit/572168a016ece1b7346695eb7289190c46f1ae55 | |||
| msg333407 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-01-10 16:58 | |
Joannah Nanjekye added time.CLOCK_UPTIME_RAW to the master branch (future Python 3.8). We don't add feature to stable versions (like 3.7), so I close the issue.Thanks Ricardo Fraile for the report, I wasn't aware of this clock ;-)Note: Until Python 3.8 is released, you can easily hardcode the constant in your application. Such constant rarely change. | |||
| msg333413 -(view) | Author: Ricardo Fraile (rfmoz) | Date: 2019-01-10 18:01 | |
Impressive response time, thanks team! | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:10 | admin | set | github: 79883 |
| 2019-01-10 18:01:48 | rfmoz | set | messages: +msg333413 |
| 2019-01-10 16:58:35 | vstinner | set | status: open -> closed versions: + Python 3.8 messages: +msg333407 keywords:patch,patch,patch resolution: fixed stage: patch review -> resolved |
| 2019-01-10 16:56:41 | vstinner | set | messages: +msg333406 |
| 2019-01-10 14:23:23 | vstinner | set | keywords:patch,patch,patch messages: +msg333381 |
| 2019-01-10 13:56:52 | nanjekyejoannah | set | keywords: +patch stage: patch review pull_requests: +pull_request11039 |
| 2019-01-10 13:56:42 | nanjekyejoannah | set | keywords: +patch stage: (no value) pull_requests: +pull_request11038 |
| 2019-01-10 13:56:30 | nanjekyejoannah | set | keywords: +patch stage: (no value) pull_requests: +pull_request11037 |
| 2019-01-10 12:33:45 | nanjekyejoannah | set | nosy: +nanjekyejoannah messages: +msg333376 |
| 2019-01-10 08:49:29 | xtreak | set | nosy: +xtreak |
| 2019-01-10 08:05:11 | vstinner | set | nosy: +vstinner |
| 2019-01-10 07:43:37 | rfmoz | create | |