[Python-checkins] peps: PEP 418: Add a table summarizing system clocks
victor.stinner
python-checkins at python.org
Fri Mar 30 23:16:21 CEST 2012
http://hg.python.org/peps/rev/215b14945a3f
changeset: 4175:215b14945a3f
user: Victor Stinner <victor.stinner at gmail.com>
date: Fri Mar 30 23:16:06 2012 +0200
summary:
PEP 418: Add a table summarizing system clocks
files:
pep-0418.txt | 41 +++++++++++++++++++++++++++++++++++----
1 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/pep-0418.txt b/pep-0418.txt
--- a/pep-0418.txt
+++ b/pep-0418.txt
@@ -185,20 +185,25 @@
Table summarizing all monotonic clocks:
-
========================= =============== =============== ================ ====================
Name Resolution Accuracy Adjusted by NTP? Action on suspend
========================= =============== =============== ================ ====================
-CLOCK_MONOTONIC_RAW 1 ns ? No Stopped
-gethrtime 1 ns ? No Not stopped
+CLOCK_MONOTONIC_RAW 1 ns (*) No Stopped
+gethrtime 1 ns (*) No Not stopped
+CLOCK_HIGHRES 1 ns (*) No ?
+CLOCK_MONOTONIC 1 ns (*) Yes on Linux Stopped on Linux
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 Accuracy issue
GetTickCount[64]() 1 ms 1 ms - 15 ms No Include suspend time
timeGetTime() 1 ms 1 ms - 15 ms No ?
========================= =============== =============== ================ ====================
+(*) The accurary of monotonic clocks depends on the operating system.
+
+ * Linux: ?
+ * FreeBSD: ?
+ * Solaris: ?
+
The resolution is the smallest difference between two timestamps supported by
the format used by the clock. For example, clock_gettime() uses a timespec
structure which has two integer fileds, tv_sec and tv_nsec, so the resolution
@@ -401,6 +406,32 @@
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:
+
+========================= =============== ===============
+Name Resolution Accuracy
+========================= =============== ===============
+CLOCK_REALTIME 1 ns (*)
+GetSystemTimeAsFileTime 100 ns 1 ms - 15 ms
+gettimeofday() 1 µs (*)
+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: ?
+
+
Windows: GetSystemTimeAsFileTime
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list