[Python-checkins] peps: PEP 418: Mention the Technical Q&A QA1398 for mach_absolute_time()
victor.stinner
python-checkins at python.org
Wed Mar 28 02:59:19 CEST 2012
http://hg.python.org/peps/rev/05bfb02e57db
changeset: 4161:05bfb02e57db
user: Victor Stinner <victor.stinner at gmail.com>
date: Wed Mar 28 02:59:01 2012 +0200
summary:
PEP 418: Mention the Technical Q&A QA1398 for mach_absolute_time()
files:
pep-0418.txt | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/pep-0418.txt b/pep-0418.txt
--- a/pep-0418.txt
+++ b/pep-0418.txt
@@ -137,7 +137,7 @@
It is available on all platforms and cannot fail.
-Pseudo-code [#pseudo]_: ::
+Pseudo-code::
def hires():
if hires.use_monotonic:
@@ -158,11 +158,15 @@
mach_absolute_time
^^^^^^^^^^^^^^^^^^
-Mac OS X provides a monotonic clock: mach_absolute_time(). mach_timebase_info()
-provides a fraction to convert the clock value to a number of nanoseconds.
+Mac OS X provides a monotonic clock: mach_absolute_time(). It is based on
+absolute elapsed time delta since system boot. It is not adjusted and cannot be
+set.
-According to the documentation, mach_timebase_info() is always equals to one
-and does never fail, even if the function may fail according to its prototype.
+mach_timebase_info() gives a fraction to convert the clock value to a number of
+nanoseconds. According to the documentation (`Technical Q&A QA1398
+<https://developer.apple.com/library/mac/#qa/qa1398/>`_), mach_timebase_info()
+is always equals to one and does never fail, even if the function may fail
+according to its prototype.
mach_absolute_time() has a resolution of 1 nanosecond.
@@ -189,7 +193,7 @@
clock_getres() gives the clock resolution. It is 1 nanosecond on Linux.
.. note::
- clock_gettime() requires to link the program with the realtime ("rt") library.
+ clock_gettime() requires to link the program to the rt (real-time) library.
QueryPerformanceCounter
^^^^^^^^^^^^^^^^^^^^^^^
@@ -197,7 +201,6 @@
High-resolution performance counter. It is monotonic.
QueryPerformanceFrequency() gives its frequency.
-
On Windows XP, QueryPerformanceFrequency() is the processor frequency and
QueryPerformanceCounter() is the TSC of the current processor. Windows XP
had a bug (see `KB896256 <http://support.microsoft.com/?id=896256>`_): on a
@@ -315,9 +318,9 @@
One function with a flag: time.monotonic(strict=False)
----------------------------------------------------------
- * time.monotonic(strict=False) falls back to another clock if no monotonic clock
- is not available or does not work, but it does never fail.
- * time.monotonic(strict=True) raises OSError if monotonic clock fails or
+ * time.monotonic(strict=False) falls back to the system clock if no monotonic
+ clock is available or if the monotonic clock failed.
+ * time.monotonic(strict=True) raises OSError if monotonic clock fails and
NotImplementedError if the system does not provide a monotonic clock
"A keyword argument that gets passed as a constant in the caller is usually
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list