[issue14104] Implement time.monotonic() on Mac OS X

2012-03-12 Thread STINNER Victor
STINNER Victor added the comment: Path commited, thanks for the patch Nicholas! -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue14104] Implement time.monotonic() on Mac OS X

2012-03-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3c875719e46d by Victor Stinner in branch 'default': Issue #14104: Implement time.monotonic() on Mac OS X, http://hg.python.org/cpython/rev/3c875719e46d -- nosy: +python-dev ___ Python tracker

[issue14104] Implement time.monotonic() on Mac OS X

2012-03-12 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue14104] Implement time.monotonic() on Mac OS X

2012-03-12 Thread Nicholas Riley
Nicholas Riley added the comment: OK, you have a point :-) New patch attached. -- Added file: http://bugs.python.org/file24804/monotonic-2.patch ___ Python tracker ___

[issue14104] Implement time.monotonic() on Mac OS X

2012-03-12 Thread Ned Deily
Changes by Ned Deily : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue14104] Implement time.monotonic() on Mac OS X

2012-03-12 Thread STINNER Victor
STINNER Victor added the comment: > timebase.numer and timebase.denom are always 1 in practice In this case, you will not lose precision and it's safe to cast to double to multiply and divide ;-) -- ___ Python tracker

[issue14104] Implement time.monotonic() on Mac OS X

2012-03-12 Thread Nicholas Riley
Nicholas Riley added the comment: timebase.numer and timebase.denom are always 1 in practice (see the "note" in the tech Q&A); I included them for completeness, but maybe it's just better to not bother? -- ___ Python tracker

[issue14104] Implement time.monotonic() on Mac OS X

2012-03-12 Thread STINNER Victor
STINNER Victor added the comment: > Attached is a patch which implements time.monotonic() using > mach_absolute_time() / mach_timebase_info(). Is it possible that mach_timebase_info() fails? No according to the Technical Q&A QA1398. > time * timebase.numer / timebase.denom "time * timebase.n

[issue14104] Implement time.monotonic() on Mac OS X

2012-03-12 Thread Nicholas Riley
Nicholas Riley added the comment: Attached is a patch which implements time.monotonic() using mach_absolute_time() / mach_timebase_info(). This was recommended by Apple in their technical Q&A 1398: https://developer.apple.com/library/mac/#qa/qa1398/ -- keywords: +patch nosy: +nriley

[issue14104] Implement time.monotonic() on Mac OS X

2012-02-23 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +ned.deily, ronaldoussoren ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14104] Implement time.monotonic() on Mac OS X

2012-02-23 Thread STINNER Victor
New submission from STINNER Victor : time.monotonic() can use mach_absolute_time() on Mac OS X. mach_timebase_info() may be used to convert the result to a number of seconds. Examples: https://github.com/ThomasHabets/monotonic_clock/blob/master/src/monotonic_mach.c http://svn.boost.org/svn/boos