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.
Created on 2012年01月24日 00:22 by vstinner, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| monotonic.patch | vstinner, 2012年01月24日 00:22 | review | ||
| Messages (11) | |||
|---|---|---|---|
| msg151868 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年01月24日 00:22 | |
After time.wallclock() (issue #10278), let add a time.monotomic() function. It is similar to time.wallclock() (try to get the most accurate clock) but is not available if the system doesn't provide a monotonic clock. It may also fail at runtime if Python cannot find a monotonic clock, whereas time.clock() and time.wallclock() fallback on a wallclock which may go backward on NTP adjust. The documentation of the patch should be improved :-) wallclock() tests may be simplified or dropped because they may fail on NTP adjust. |
|||
| msg152138 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2012年01月27日 23:16 | |
Do we actually yet another function, or could this be covered by adding a parameter such as monotonic=False, perhaps to wallclock(). |
|||
| msg152280 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年01月29日 23:09 | |
> Do we actually yet another function, or could this be covered by adding a parameter such as monotonic=False, perhaps to wallclock(). A monotonic is a different clock, it would be surprising that an argument uses another clock. |
|||
| msg152505 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年02月03日 13:40 | |
I don’t understand why this new function would be useful. Time-related modules in Python are already complicated. |
|||
| msg152506 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年02月03日 13:46 | |
If you are trying to time something (an interval), having the time go backward can really screw up your data. And that *will* happen on a system that is running NTP (or even just resets its time). monotonic clocks were introduced at the OS level for a reason, and it seems reasonable for Python to expose them (when the are available) like it does other system resources. |
|||
| msg152514 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年02月03日 14:12 | |
Thanks, now I see the usefulness. |
|||
| msg152816 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年02月07日 22:29 | |
New changeset 376ce937823c by Victor Stinner in branch 'default': Issue #13846: Add time.monotonic(), monotonic clock. http://hg.python.org/cpython/rev/376ce937823c |
|||
| msg152860 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年02月08日 14:25 | |
Victor, I think the doc doesn’t say why the function is useful for people like me who don’t already know it. David’s explanation could be reused. |
|||
| msg153774 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2012年02月20日 10:43 | |
Boost has a monotonic time implementation (steady_clock) for OS X: http://svn.boost.org/svn/boost/trunk/boost/chrono/detail/inlined/mac/chrono.hpp |
|||
| msg154096 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年02月23日 23:10 | |
New changeset 50b1f2d07011 by Victor Stinner in branch 'default': Issue #13846: Enhance time.monotonic() documentation http://hg.python.org/cpython/rev/50b1f2d07011 |
|||
| msg154097 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年02月23日 23:11 | |
> Boost has a monotonic time implementation (steady_clock) for OS X I opened a new issue for Mac OS X: #14104. -- @Éric: I enhanced the doc. Feel free to complete or rewrite it if you have better information about such clocks. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:26 | admin | set | github: 58054 |
| 2012年02月23日 23:11:18 | vstinner | set | messages: + msg154097 |
| 2012年02月23日 23:10:17 | python-dev | set | messages: + msg154096 |
| 2012年02月20日 10:43:23 | pitrou | set | nosy:
+ pitrou, ned.deily messages: + msg153774 |
| 2012年02月08日 14:25:30 | eric.araujo | set | messages: + msg152860 |
| 2012年02月07日 22:30:30 | vstinner | set | status: open -> closed resolution: fixed |
| 2012年02月07日 22:29:16 | python-dev | set | nosy:
+ python-dev messages: + msg152816 |
| 2012年02月03日 14:12:30 | eric.araujo | set | messages: + msg152514 |
| 2012年02月03日 13:46:44 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg152506 |
| 2012年02月03日 13:40:05 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg152505 |
| 2012年01月29日 23:09:39 | vstinner | set | messages: + msg152280 |
| 2012年01月27日 23:16:34 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg152138 type: enhancement stage: patch review |
| 2012年01月24日 21:39:03 | giampaolo.rodola | set | nosy:
+ giampaolo.rodola |
| 2012年01月24日 04:11:58 | rosslagerwall | set | nosy:
+ rosslagerwall |
| 2012年01月24日 00:22:29 | vstinner | create | |