[Python-checkins] peps: PEP 418: Complete "Precision in Python" column in the different tables
victor.stinner
python-checkins at python.org
Sat Apr 14 00:18:24 CEST 2012
http://hg.python.org/peps/rev/d454bba39db5
changeset: 4243:d454bba39db5
user: Victor Stinner <victor.stinner at gmail.com>
date: Sat Apr 14 00:17:54 2012 +0200
summary:
PEP 418: Complete "Precision in Python" column in the different tables
files:
pep-0418.txt | 67 ++++++++++++++++++++-------------------
1 files changed, 35 insertions(+), 32 deletions(-)
diff --git a/pep-0418.txt b/pep-0418.txt
--- a/pep-0418.txt
+++ b/pep-0418.txt
@@ -725,15 +725,15 @@
========================= ================ ========= ===================
Name Operating system Precision Precision in Python
========================= ================ ========= ===================
+CLOCK_HIGHRES SunOS 5.11 2 ns 2 µs
+CLOCK_MONOTONIC Linux 3.2 1 ns 2 µs
+CLOCK_MONOTONIC SunOS 5.11 2 ns 3 µs
CLOCK_MONOTONIC_RAW Linux 3.2 1 ns 3 µs
-CLOCK_MONOTONIC Linux 3.2 1 ns 2 µs
-CLOCK_HIGHRES SunOS 5.11 2 ns ?
-CLOCK_MONOTONIC SunOS 5.11 2 ns ?
-QueryPerformanceCounter Windows Seven 10 ns ?
+CLOCK_MONOTONIC FreeBSD 8.2 11 ns 7 µs
+CLOCK_MONOTONIC OpenBSD 5.0 10 ms 7 µs
+QueryPerformanceCounter Windows Seven 10 ns 9 µs
CLOCK_UPTIME FreeBSD 8.2 11 ns 9 µs
-CLOCK_MONOTONIC FreeBSD 8.2 11 ns 7 µs
-CLOCK_MONOTONIC OpenBSD 5.0 10 ms ?
-GetTickCount Windows Seven 16 ms ?
+GetTickCount Windows Seven 16 ms 15 ms
========================= ================ ========= ===================
For CLOCK_xxx clocks, the precision of this table is the result of
@@ -976,11 +976,11 @@
========================= ================ ========= ===================
Name Operating system Precision Precision in Python
========================= ================ ========= ===================
+CLOCK_REALTIME SunOS 5.11 10 ms 2 µs
CLOCK_REALTIME Linux 3.2 1 ns 2 µs
CLOCK_REALTIME FreeBSD 8.2 11 ns 7 µs
-CLOCK_REALTIME SunOS 5.11 10 ms ?
-CLOCK_REALTIME OpenBSD 5.0 10 ms ?
-GetSystemTimeAsFileTime Windows Seven 16 ms ?
+CLOCK_REALTIME OpenBSD 5.0 10 ms 10 µs
+GetSystemTimeAsFileTime Windows Seven 16 ms 1 ms
========================= ================ ========= ===================
For CLOCK_REALTIME, the precision of this table is the result of
@@ -1026,15 +1026,15 @@
The process time cannot be set. It is not monotonic: the clocks stop
while the process is idle.
-========================= =============== =============
-Name Resolution Include sleep
-========================= =============== =============
-GetProcessTimes() 100 ns No
-CLOCK_PROCESS_CPUTIME_ID 1 ns No
-getrusage() 1 µs No
-times() \- No
-clock() \- No (*)
-========================= =============== =============
+========================= ========== =============
+Name Resolution Include sleep
+========================= ========== =============
+GetProcessTimes() 100 ns No
+CLOCK_PROCESS_CPUTIME_ID 1 ns No
+getrusage(RUSAGE_SELF) 1 µs No
+times() \- No
+clock() \- No (*)
+========================= ========== =============
(*) On Windows, clock() does include time elapsed during a sleep. It does not
on other operating systems.
@@ -1044,15 +1044,18 @@
========================= ================ ========= ===================
Name Operating system Precision Precision in Python
========================= ================ ========= ===================
+getrusage(RUSAGE_SELF) FreeBSD 8.2 \- 1 µs
CLOCK_PROCESS_CPUTIME_ID Linux 3.2 1 ns 3 µs
-clock() SunOS 5.11 1 µs ?
-getrusage() Linux 3.0 4 ms 4 ms
-getrusage() FreeBSD 8.2 - 1 µs
+getrusage(RUSAGE_SELF) SunOS 5.11 \- 3 µs
+getrusage(RUSAGE_SELF) Linux 3.0 4 ms 4 ms
+getrusage(RUSAGE_SELF) OpenBSD 5.0 \- 8 ms
clock() FreeBSD 8.2 8 ms 8 ms
clock() Linux 3.2 1 µs 10 ms
times() Linux 3.0 10 ms 10 ms
-clock() OpenBSD 5.0 10 ms ?
-GetProcessTimes() Windows Seven 16 ms ?
+clock() OpenBSD 5.0 10 ms 10 ms
+times() OpenBSD 5.0 10 ms 10 ms
+GetProcessTimes() Windows Seven 16 ms 16 ms
+clock() SunOS 5.11 1 µs 10 ms
========================= ================ ========= ===================
The precision of clock() in this table is the result of 1 /
@@ -1080,7 +1083,7 @@
program.
* times()
-* getrusage(): ru_utime and ru_stime fields
+* getrusage(RUSAGE_SELF): ru_utime and ru_stime fields
Python source code includes a portable library to get the process time (CPU
time): `Tools/pybench/systimes.py
@@ -1093,21 +1096,21 @@
The thread time cannot be set. It is not monotonic: the clocks stop
while the thread is idle.
-========================= ===============
+========================= ==========
Name Resolution
-========================= ===============
-GetThreadTimes() 100 ns
-CLOCK_THREAD_CPUTIME_ID 1 ns
-========================= ===============
+========================= ==========
+CLOCK_THREAD_CPUTIME_ID 1 ns
+GetThreadTimes() 100 ns
+========================= ==========
Examples of clock precision on x86_64:
========================= ================ =============== ===================
Name Operating system Precision Precision in Python
========================= ================ =============== ===================
+CLOCK_THREAD_CPUTIME_ID FreeBSD 8.2 1 µs 1 µs
CLOCK_THREAD_CPUTIME_ID Linux 3.2 1 ns 6 µs
-CLOCK_THREAD_CPUTIME_ID FreeBSD 8.2 1 µs 1 µs
-GetThreadTimes() Windows Seven 16 ms ?
+GetThreadTimes() Windows Seven 16 ms 16 ms
========================= ================ =============== ===================
For CLOCK_THREAD_CPUTIME_ID, the precision of this table is the result
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list