PEP 418: Fix time.highres() pseudo code

This commit is contained in:
Victor Stinner 2012-03-31 01:39:46 +02:00
parent 8e9a3c50ca
commit 53fa07dcc6
1 changed files with 10 additions and 30 deletions

View File

@ -172,14 +172,14 @@ It is available on all platforms and cannot fail.
Pseudo-code::
def highres():
if monotonic.use_performance_counter:
if highres.use_performance_counter:
try:
return _time.QueryPerformanceCounter()
except OSError:
# QueryPerformanceFrequency() may fail, if the installed
# hardware does not support a high-resolution performance
# counter for example
monotonic.use_performance_counter = False
highres.use_performance_counter = False
if highres.use_monotonic:
# Monotonic clock is preferred over system clock
try:
@ -194,13 +194,8 @@ Pseudo-code::
Clocks
======
Monotonic
---------
Summary
^^^^^^^
Table summarizing all monotonic clocks:
Monotonic clocks
----------------
========================= =============== =============== ================ ====================
Name Resolution Accuracy Adjusted by NTP? Action on suspend
@ -215,11 +210,8 @@ GetTickCount[64]() 1 ms 1 ms - 15 ms No Inclu
timeGetTime() 1 ms 1 ms - 15 ms No ?
========================= =============== =============== ================ ====================
(*) The accurary of monotonic clocks depends on the operating system.
* Linux: ?
* FreeBSD: ?
* Solaris: ?
(*) The accurary of monotonic clocks depends on the operating system and the
hardware clock.
The resolution is the smallest difference between two timestamps supported by
the format used by the clock. For example, clock_gettime() uses a timespec
@ -420,16 +412,8 @@ Read the `gethrtime() manual page of Solaris 11
On Solaris, gethrtime() is the same as clock_gettime(CLOCK_MONOTONIC).
System time
-----------
The system time can be set manually by the system administrator or
automatically by a NTP daemon.
Summary
^^^^^^^
Table summarizing all system time clocks:
System time clocks
------------------
========================= =============== ===============
Name Resolution Accuracy
@ -441,12 +425,8 @@ ftime() 1 ms (*)
time() 1 sec 1 sec
========================= =============== ===============
(*) The accurary of system clocks depends on the operating system.
* Windows: 1 ms - 15 ms
* Linux: ?
* Mac OS X: ?
* FreeBSD: ?
(*) The accurary of system clocks depends on the operating system and the
hardware clock. On Windows, the accuracy is in the range 1 ms - 15 ms.
Windows: GetSystemTimeAsFileTime