PEP 418: Complete "Precision in Python" column in the different tables
This commit is contained in:
parent
165038702e
commit
44f95fb601
67
pep-0418.txt
67
pep-0418.txt
|
@ -725,15 +725,15 @@ Examples of clock precision on x86_64:
|
||||||
========================= ================ ========= ===================
|
========================= ================ ========= ===================
|
||||||
Name Operating system Precision Precision in Python
|
Name Operating system Precision Precision in Python
|
||||||
========================= ================ ========= ===================
|
========================= ================ ========= ===================
|
||||||
CLOCK_MONOTONIC_RAW Linux 3.2 1 ns 3 µs
|
CLOCK_HIGHRES SunOS 5.11 2 ns 2 µs
|
||||||
CLOCK_MONOTONIC Linux 3.2 1 ns 2 µs
|
CLOCK_MONOTONIC Linux 3.2 1 ns 2 µs
|
||||||
CLOCK_HIGHRES SunOS 5.11 2 ns ?
|
CLOCK_MONOTONIC SunOS 5.11 2 ns 3 µs
|
||||||
CLOCK_MONOTONIC SunOS 5.11 2 ns ?
|
CLOCK_MONOTONIC_RAW Linux 3.2 1 ns 3 µs
|
||||||
QueryPerformanceCounter Windows Seven 10 ns ?
|
|
||||||
CLOCK_UPTIME FreeBSD 8.2 11 ns 9 µs
|
|
||||||
CLOCK_MONOTONIC FreeBSD 8.2 11 ns 7 µs
|
CLOCK_MONOTONIC FreeBSD 8.2 11 ns 7 µs
|
||||||
CLOCK_MONOTONIC OpenBSD 5.0 10 ms ?
|
CLOCK_MONOTONIC OpenBSD 5.0 10 ms 7 µs
|
||||||
GetTickCount Windows Seven 16 ms ?
|
QueryPerformanceCounter Windows Seven 10 ns 9 µs
|
||||||
|
CLOCK_UPTIME FreeBSD 8.2 11 ns 9 µs
|
||||||
|
GetTickCount Windows Seven 16 ms 15 ms
|
||||||
========================= ================ ========= ===================
|
========================= ================ ========= ===================
|
||||||
|
|
||||||
For CLOCK_xxx clocks, the precision of this table is the result of
|
For CLOCK_xxx clocks, the precision of this table is the result of
|
||||||
|
@ -976,11 +976,11 @@ Examples of clock precision on x86_64:
|
||||||
========================= ================ ========= ===================
|
========================= ================ ========= ===================
|
||||||
Name Operating system Precision Precision in Python
|
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 Linux 3.2 1 ns 2 µs
|
||||||
CLOCK_REALTIME FreeBSD 8.2 11 ns 7 µs
|
CLOCK_REALTIME FreeBSD 8.2 11 ns 7 µs
|
||||||
CLOCK_REALTIME SunOS 5.11 10 ms ?
|
CLOCK_REALTIME OpenBSD 5.0 10 ms 10 µs
|
||||||
CLOCK_REALTIME OpenBSD 5.0 10 ms ?
|
GetSystemTimeAsFileTime Windows Seven 16 ms 1 ms
|
||||||
GetSystemTimeAsFileTime Windows Seven 16 ms ?
|
|
||||||
========================= ================ ========= ===================
|
========================= ================ ========= ===================
|
||||||
|
|
||||||
For CLOCK_REALTIME, the precision of this table is the result of
|
For CLOCK_REALTIME, the precision of this table is the result of
|
||||||
|
@ -1026,15 +1026,15 @@ Process time
|
||||||
The process time cannot be set. It is not monotonic: the clocks stop
|
The process time cannot be set. It is not monotonic: the clocks stop
|
||||||
while the process is idle.
|
while the process is idle.
|
||||||
|
|
||||||
========================= =============== =============
|
========================= ========== =============
|
||||||
Name Resolution Include sleep
|
Name Resolution Include sleep
|
||||||
========================= =============== =============
|
========================= ========== =============
|
||||||
GetProcessTimes() 100 ns No
|
GetProcessTimes() 100 ns No
|
||||||
CLOCK_PROCESS_CPUTIME_ID 1 ns No
|
CLOCK_PROCESS_CPUTIME_ID 1 ns No
|
||||||
getrusage() 1 µs No
|
getrusage(RUSAGE_SELF) 1 µs No
|
||||||
times() \- No
|
times() \- No
|
||||||
clock() \- No (*)
|
clock() \- No (*)
|
||||||
========================= =============== =============
|
========================= ========== =============
|
||||||
|
|
||||||
(*) On Windows, clock() does include time elapsed during a sleep. It does not
|
(*) On Windows, clock() does include time elapsed during a sleep. It does not
|
||||||
on other operating systems.
|
on other operating systems.
|
||||||
|
@ -1044,15 +1044,18 @@ Examples of clock precision on x86_64:
|
||||||
========================= ================ ========= ===================
|
========================= ================ ========= ===================
|
||||||
Name Operating system Precision Precision in Python
|
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_PROCESS_CPUTIME_ID Linux 3.2 1 ns 3 µs
|
||||||
clock() SunOS 5.11 1 µs ?
|
getrusage(RUSAGE_SELF) SunOS 5.11 \- 3 µs
|
||||||
getrusage() Linux 3.0 4 ms 4 ms
|
getrusage(RUSAGE_SELF) Linux 3.0 4 ms 4 ms
|
||||||
getrusage() FreeBSD 8.2 - 1 µs
|
getrusage(RUSAGE_SELF) OpenBSD 5.0 \- 8 ms
|
||||||
clock() FreeBSD 8.2 8 ms 8 ms
|
clock() FreeBSD 8.2 8 ms 8 ms
|
||||||
clock() Linux 3.2 1 µs 10 ms
|
clock() Linux 3.2 1 µs 10 ms
|
||||||
times() Linux 3.0 10 ms 10 ms
|
times() Linux 3.0 10 ms 10 ms
|
||||||
clock() OpenBSD 5.0 10 ms ?
|
clock() OpenBSD 5.0 10 ms 10 ms
|
||||||
GetProcessTimes() Windows Seven 16 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 /
|
The precision of clock() in this table is the result of 1 /
|
||||||
|
@ -1080,7 +1083,7 @@ Functions
|
||||||
program.
|
program.
|
||||||
|
|
||||||
* times()
|
* 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
|
Python source code includes a portable library to get the process time (CPU
|
||||||
time): `Tools/pybench/systimes.py
|
time): `Tools/pybench/systimes.py
|
||||||
|
@ -1093,21 +1096,21 @@ Thread time
|
||||||
The thread time cannot be set. It is not monotonic: the clocks stop
|
The thread time cannot be set. It is not monotonic: the clocks stop
|
||||||
while the thread is idle.
|
while the thread is idle.
|
||||||
|
|
||||||
========================= ===============
|
========================= ==========
|
||||||
Name Resolution
|
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:
|
Examples of clock precision on x86_64:
|
||||||
|
|
||||||
========================= ================ =============== ===================
|
========================= ================ =============== ===================
|
||||||
Name Operating system Precision Precision in Python
|
Name Operating system Precision Precision in Python
|
||||||
========================= ================ =============== ===================
|
========================= ================ =============== ===================
|
||||||
CLOCK_THREAD_CPUTIME_ID Linux 3.2 1 ns 6 µs
|
|
||||||
CLOCK_THREAD_CPUTIME_ID FreeBSD 8.2 1 µs 1 µs
|
CLOCK_THREAD_CPUTIME_ID FreeBSD 8.2 1 µs 1 µs
|
||||||
GetThreadTimes() Windows Seven 16 ms ?
|
CLOCK_THREAD_CPUTIME_ID Linux 3.2 1 ns 6 µs
|
||||||
|
GetThreadTimes() Windows Seven 16 ms 16 ms
|
||||||
========================= ================ =============== ===================
|
========================= ================ =============== ===================
|
||||||
|
|
||||||
For CLOCK_THREAD_CPUTIME_ID, the precision of this table is the result
|
For CLOCK_THREAD_CPUTIME_ID, the precision of this table is the result
|
||||||
|
|
Loading…
Reference in New Issue