PEP 418: time.get_clock_info() may provide more information (accuracy, is_adjusted)

This commit is contained in:
Victor Stinner 2012-04-02 21:48:03 +02:00
parent 403a3a9778
commit 6d6819334c
1 changed files with 14 additions and 7 deletions

View File

@ -201,20 +201,27 @@ Pseudo-code::
time.get_clock_info(name)
-------------------------
Get information on the specified time function as a dictionary. Only the following
names are accepted:
Get information on the specified clock. Supported clocks:
* "clock": time.clock()
* "highres": time.highres()
* "monotonic": time.monotonic()
* "time": time.time()
The following keys are always present:
Return a dictionary with the following keys:
* "function" (str): name of the underlying operating system function (ex:
"QueryPerformanceCounter()" or "clock_gettime(CLOCK_REALTIME)")
* "resolution" (float): resolution in seconds of the function
* "is_monotonic" (bool): True if the clock is monotonic
* Mandatory keys:
* "function" (str): name of the underlying operating system function.
Examples: "QueryPerformanceCounter()", "clock_gettime(CLOCK_REALTIME)".
* "resolution" (float): resolution in seconds of the clock
* "is_monotonic" (bool): True if the clock cannot go backward
* Optional keys:
* "accuracy" (float): accuracy in seconds of the clock
* "is_adjusted" (bool): True if the clock can be adjusted (e.g. by a NTP
daemon)
Hardware clocks