PEP 418: Replace "Resolution" column with "C Resolution", and "Precision" with

"OS Resolution"

Document also these two columns.
This commit is contained in:
Victor Stinner 2012-04-24 00:24:08 +02:00
parent 464a098160
commit 94fb568222
1 changed files with 151 additions and 128 deletions

View File

@ -912,9 +912,9 @@ Operating system time functions
Monotonic Clocks
----------------
========================= ========== =============== ============= ===============
Name Resolution Adjusted Include sleep Include suspend
========================= ========== =============== ============= ===============
========================= ============ =============== ============= ===============
Name C Resolution Adjusted Include Sleep Include Suspend
========================= ============ =============== ============= ===============
gethrtime() 1 ns No Yes Yes
CLOCK_HIGHRES 1 ns No Yes Yes
CLOCK_MONOTONIC 1 ns Slewed on Linux Yes No
@ -926,13 +926,16 @@ mach_absolute_time() 1 ns No Yes No
QueryPerformanceCounter() \- No Yes ?
GetTickCount[64]() 1 ms No Yes Yes
timeGetTime() 1 ms No Yes ?
========================= ========== =============== ============= ===============
========================= ============ =============== ============= ===============
The "C Resolution" column is the resolution of the underlying C
structure.
Examples of clock precision on x86_64:
========================= ================ ========= =================
Name Operating system Precision Python Resolution
========================= ================ ========= =================
========================= ================ ============= =================
Name Operating system OS Resolution Python Resolution
========================= ================ ============= =================
QueryPerformanceCounter Windows Seven 10 ns 10 ns
CLOCK_HIGHRES SunOS 5.11 2 ns 265 ns
CLOCK_MONOTONIC Linux 3.0 1 ns 322 ns
@ -945,10 +948,12 @@ CLOCK_UPTIME FreeBSD 8.2 11 ns 6 µs
CLOCK_MONOTONIC_COARSE Linux 3.3 1 ms 1 ms
CLOCK_MONOTONIC_COARSE Linux 3.0 4 ms 4 ms
GetTickCount64() Windows Seven 16 ms 15 ms
========================= ================ ========= =================
========================= ================ ============= =================
The "Python Resolution" column was filled using the
`clock_resolution.py
The "OS Resolution" is the resolution announced by the operating
system.
The "Python Resolution" is the smallest difference between two calls
to the time function computed in Python using the `clock_resolution.py
<http://hg.python.org/peps/file/tip/pep-0418/clock_resolution.py>`_
program.
@ -1172,22 +1177,25 @@ On Solaris, gethrtime() is the same as clock_gettime(CLOCK_MONOTONIC).
System Time
-----------
========================= =============== ============= ===============
Name Resolution Include sleep Include suspend
========================= =============== ============= ===============
========================= ============ ============= ===============
Name C Resolution Include Sleep Include Suspend
========================= ============ ============= ===============
CLOCK_REALTIME 1 ns Yes Yes
CLOCK_REALTIME_COARSE 1 ns Yes Yes
GetSystemTimeAsFileTime 100 ns Yes Yes
gettimeofday() 1 µs Yes Yes
ftime() 1 ms Yes Yes
time() 1 sec Yes Yes
========================= =============== ============= ===============
========================= ============ ============= ===============
The "C Resolution" column is the resolution of the underlying C
structure.
Examples of clock precision on x86_64:
========================= ================ ========= =================
Name Operating system Precision Python Resolution
========================= ================ ========= =================
========================= ================ ============= =================
Name Operating system OS Resolution Python Resolution
========================= ================ ============= =================
CLOCK_REALTIME SunOS 5.11 10 ms 238 ns
CLOCK_REALTIME Linux 3.0 1 ns 238 ns
gettimeofday() Mac OS 10.6 1 µs 4 µs
@ -1197,10 +1205,12 @@ CLOCK_REALTIME_COARSE Linux 3.3 1 ms 1 ms
CLOCK_REALTIME_COARSE Linux 3.0 4 ms 4 ms
GetSystemTimeAsFileTime() Windows Seven 16 ms 1 ms
ftime() Windows Seven \- 1 ms
========================= ================ ========= =================
========================= ================ ============= =================
The "Python Resolution" column was filled using the
`clock_resolution.py
The "OS Resolution" is the resolution announced by the operating
system.
The "Python Resolution" is the smallest difference between two calls
to the time function computed in Python using the `clock_resolution.py
<http://hg.python.org/peps/file/tip/pep-0418/clock_resolution.py>`_
program.
@ -1242,21 +1252,24 @@ Process Time
The process time cannot be set. It is not monotonic: the clocks stop
while the process is idle.
========================= ========== ============================ ===============
Name Resolution Include sleep Include suspend
========================= ========== ============================ ===============
========================= ============ ============================ ===============
Name C Resolution Include Sleep Include Suspend
========================= ============ ============================ ===============
GetProcessTimes() 100 ns No No
CLOCK_PROCESS_CPUTIME_ID 1 ns No No
getrusage(RUSAGE_SELF) 1 µs No No
times() \- No No
clock() \- Yes on Windows, No otherwise No
========================= ========== ============================ ===============
========================= ============ ============================ ===============
The "C Resolution" column is the resolution of the underlying C
structure.
Examples of clock precision on x86_64:
========================= ================ ========= ===================
Name Operating system Precision Python Resolution
========================= ================ ========= ===================
========================= ================ ============= ===================
Name Operating system OS Resolution Python Resolution
========================= ================ ============= ===================
CLOCK_PROCESS_CPUTIME_ID Linux 3.3 1 ns 1 ns
CLOCK_PROF FreeBSD 8.2 10 ms 1 µs
getrusage(RUSAGE_SELF) FreeBSD 8.2 \- 1 µs
@ -1277,10 +1290,12 @@ clock() SunOS 5.11 1 µs 10 ms
times() SunOS 5.11 1 µs 10 ms
GetProcessTimes() Windows Seven 16 ms 16 ms
clock() Windows Seven 1 ms 1 ms
========================= ================ ========= ===================
========================= ================ ============= ===================
The "Python Resolution" column was filled using the
`clock_resolution.py
The "OS Resolution" is the resolution announced by the operating
system.
The "Python Resolution" is the smallest difference between two calls
to the time function computed in Python using the `clock_resolution.py
<http://hg.python.org/peps/file/tip/pep-0418/clock_resolution.py>`_
program.
@ -1321,25 +1336,30 @@ Thread Time
The thread time cannot be set. It is not monotonic: the clocks stop
while the thread is idle.
========================= ========== ============= ===============
Name Resolution Include sleep Include suspend
========================= ========== ============= ===============
========================= ============ ============= ===============
Name C Resolution Include Sleep Include Suspend
========================= ============ ============= ===============
CLOCK_THREAD_CPUTIME_ID 1 ns Yes Epoch changes
GetThreadTimes() 100 ns No ?
========================= ========== ============= ===============
========================= ============ ============= ===============
The "C Resolution" column is the resolution of the underlying C
structure.
Examples of clock precision on x86_64:
========================= ================ =============== =================
Name Operating system Precision Python Resolution
========================= ================ =============== =================
========================= ================ ============= =================
Name Operating system OS Resolution Python Resolution
========================= ================ ============= =================
CLOCK_THREAD_CPUTIME_ID FreeBSD 8.2 1 µs 1 µs
CLOCK_THREAD_CPUTIME_ID Linux 3.3 1 ns 649 ns
GetThreadTimes() Windows Seven 16 ms 16 ms
========================= ================ =============== =================
========================= ================ ============= =================
The "Python Resolution" column was filled using the
`clock_resolution.py
The "OS Resolution" is the resolution announced by the operating
system.
The "Python Resolution" is the smallest difference between two calls
to the time function computed in Python using the `clock_resolution.py
<http://hg.python.org/peps/file/tip/pep-0418/clock_resolution.py>`_
program.
@ -1388,21 +1408,21 @@ sleep duration is 90 seconds in the real time.
Sleep can be interrupted by a signal: the function fails with EINTR.
======================== ==========
Name Resolution
======================== ==========
======================== ============
Name C Resolution
======================== ============
nanosleep() 1 ns
clock_nanosleep() 1 ns
usleep() 1 µs
delay() 1 µs
sleep() 1 sec
======================== ==========
======================== ============
Other functions:
======================== ==========
Name Resolution
======================== ==========
======================== ============
Name C Resolution
======================== ============
sigtimedwait() 1 ns
pthread_cond_timedwait() 1 ns
sem_timedwait() 1 ns
@ -1410,7 +1430,10 @@ select() 1 µs
epoll() 1 ms
poll() 1 ms
WaitForSingleObject() 1 ms
======================== ==========
======================== ============
The "C Resolution" column is the resolution of the underlying C
structure.
Functions