[Python-checkins] peps: PEP 418: Try to fill the "Action on suspend" column
victor.stinner
python-checkins at python.org
Fri Mar 30 04:21:24 CEST 2012
http://hg.python.org/peps/rev/f0a64781e500
changeset: 4171:f0a64781e500
user: Victor Stinner <victor.stinner at gmail.com>
date: Fri Mar 30 04:21:11 2012 +0200
summary:
PEP 418: Try to fill the "Action on suspend" column
files:
pep-0418.txt | 29 +++++++++++++++++++++--------
1 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/pep-0418.txt b/pep-0418.txt
--- a/pep-0418.txt
+++ b/pep-0418.txt
@@ -186,18 +186,18 @@
Table summarizing all monotonic clocks:
-========================= =============== ================ =================
+========================= =============== ================ ====================
Name Resolution Adjusted by NTP? Action on suspend
-========================= =============== ================ =================
-CLOCK_MONOTONIC_RAW 1 ns No ?
-gethrtime 1 ns No ?
+========================= =============== ================ ====================
+CLOCK_MONOTONIC_RAW 1 ns No Stopped
+gethrtime 1 ns No Not stopped
mach_absolute_time() 1 ns No ?
CLOCK_HIGHRES 1 ns No ?
CLOCK_MONOTONIC 1 ns Yes on Linux Stopped on Linux
-QueryPerformanceCounter() 0.3 ns - 5 ns No ?
-GetTickCount[64]() 1 ms - 15 ms No ?
+QueryPerformanceCounter() 0.3 ns - 5 ns No Accuracy issue
+GetTickCount[64]() 1 ms - 15 ms No Include suspend time
timeGetTime() 1 ms - 15 ms No ?
-========================= =============== ================ =================
+========================= =============== ================ ====================
mach_absolute_time
^^^^^^^^^^^^^^^^^^
@@ -212,6 +212,10 @@
is always equals to one and does never fail, even if the function may fail
according to its prototype.
+mach_absolute_time() stops during a sleep on PowerPC CPU, but not on Intel CPU:
+`Different behaviour of mach_absolute_time() on i386 / ppc
+<http://lists.apple.com/archives/PerfOptimization-dev/2006/Jul/msg00024.html>`_.
+
mach_absolute_time() has a resolution of 1 nanosecond.
CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW
@@ -319,6 +323,9 @@
`GetTickCount() <http://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx>`_,
`GetTickCount64() <http://msdn.microsoft.com/en-us/library/windows/desktop/ms724411(v=vs.85).aspx>`_.
+The elapsed time retrieved by GetTickCount or GetTickCount64 includes time the
+system spends in sleep or hibernation.
+
GetTickCount64() was added to Windows Vista and Windows Server 2008.
The clock resolution is 1 millisecond. Its accuracy is usually around 15 ms. It
@@ -371,6 +378,9 @@
is ideally suited to performance measurement tasks, where cheap, accurate
interval timing is required.
+The linearity of gethrtime() is not preserved accross cpr suspend-resume cycle
+(`Bug 4272663 <http://wesunsolve.net/bugid/id/4272663>`_).
+
Read the `gethrtime() manual page of Solaris 11
<http://docs.oracle.com/cd/E23824_01/html/821-1465/gethrtime-3c.html#scrolltoc>`_.
@@ -455,13 +465,15 @@
Windows: QueryUnbiasedInterruptTime
------------------------------------
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Gets the current unbiased interrupt time from the biased interrupt time and the
current sleep bias amount. This time is not affected by power management sleep
transitions.
-Is it monotonic?
+The elapsed time retrieved by the QueryUnbiasedInterruptTime function includes
+only time that the system spends in the working state.
+QueryUnbiasedInterruptTime() is not monotonic.
QueryUnbiasedInterruptTime() was introduced in Windows 7.
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list