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年03月12日 23:24 by nicholas.riley, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| monotonic-doc.patch | nicholas.riley, 2012年03月13日 00:38 | review | ||
| Messages (5) | |||
|---|---|---|---|
| msg155518 - (view) | Author: Nicholas Riley (nicholas.riley) * | Date: 2012年03月12日 23:24 | |
Currently: >>> help(time.monotonic) Help on built-in function monotonic in module time: monotonic(...) monotonic() -> float Monotonic clock. The reference point of the returned value is undefined so only the difference of consecutive calls is valid. |
|||
| msg155525 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年03月12日 23:36 | |
time.monotonic() has 3 implementations: * Windows: QueryPerformanceCounter() with QueryPerformanceFrequency() * Mac OS X: mach_absolute_time() with mach_timebase_info() * UNIX: clock_gettime(CLOCK_MONOTONIC_RAW) or clock_gettime(CLOCK_MONOTONIC) QueryPerformanceFrequency() returns the frequency "in counts per second" according to the doc. http://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx mach_absolute_time() with mach_timebase_info() returns a number of seconds, but Python uses *1e-9. clock_gettime() uses a timespec structure and Python uses *1e-9. It looks like to mention that time.monotonic() unit is seconds. |
|||
| msg155541 - (view) | Author: Nicholas Riley (nicholas.riley) * | Date: 2012年03月13日 00:38 | |
According to http://juliusdavies.ca/posix_clocks/clock_realtime_linux_faq.html, CLOCK_REALTIME can go backwards. CLOCK_MONOTONIC_RAW is best where available (like QueryPerformanceFrequency / mach_absolute_time) and CLOCK_MONOTONIC is pretty good. So I have updated both the docs for time.monotonic and time.wallclock to hopefully better explain things... may need to be another issue here too. |
|||
| msg156331 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年03月19日 12:15 | |
The unit (seconds) is not mentioned in the doc. Related changesets: 27441e0d6a75 and c11946846474. |
|||
| msg156332 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年03月19日 12:15 | |
> The unit (seconds) is not mentioned in the doc The unit (seconds) is *now* mentioned in the doc |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:27 | admin | set | github: 58485 |
| 2012年03月19日 12:15:37 | vstinner | set | messages: + msg156332 |
| 2012年03月19日 12:15:11 | vstinner | set | status: open -> closed resolution: fixed messages: + msg156331 |
| 2012年03月13日 00:38:47 | nicholas.riley | set | files:
+ monotonic-doc.patch keywords: + patch messages: + msg155541 |
| 2012年03月12日 23:36:20 | vstinner | set | nosy:
+ vstinner messages: + msg155525 |
| 2012年03月12日 23:24:43 | nicholas.riley | create | |