summaryrefslogtreecommitdiffstats
path: root/Doc/library/time.rst
diff options
context:
space:
mode:
authorpdox <pdox@alum.mit.edu>2017-10-05 07:01:56 (GMT)
committerBenjamin Peterson <benjamin@python.org>2017-10-05 07:01:56 (GMT)
commite14679c78464d1e0e16786c2a0e9bcebe49e842b (patch)
tree066f524eae0f2de963387477482575462393a6c8 /Doc/library/time.rst
parent55fd06605b5d4fb6442645f1532aa05953bd93bc (diff)
downloadcpython-e14679c78464d1e0e16786c2a0e9bcebe49e842b.zip
cpython-e14679c78464d1e0e16786c2a0e9bcebe49e842b.tar.gz
cpython-e14679c78464d1e0e16786c2a0e9bcebe49e842b.tar.bz2
closes bpo-31596: Add an interface for pthread_getcpuclockid(3) (#3756)
Diffstat (limited to 'Doc/library/time.rst')
-rw-r--r--Doc/library/time.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/Doc/library/time.rst b/Doc/library/time.rst
index ef0e69a..179762e 100644
--- a/Doc/library/time.rst
+++ b/Doc/library/time.rst
@@ -162,6 +162,22 @@ The module defines the following functions and data items:
:func:`perf_counter` or :func:`process_time` instead, depending on your
requirements, to have a well defined behaviour.
+.. function:: pthread_getcpuclockid(thread_id)
+
+ Return the *clk_id* of the thread-specific CPU-time clock for the specified *thread_id*.
+
+ Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident`
+ attribute of :class:`threading.Thread` objects to get a suitable value
+ for *thread_id*.
+
+ .. warning::
+ Passing an invalid or expired *thread_id* may result in
+ undefined behavior, such as segmentation fault.
+
+ Availability: Unix (see the man page for :manpage:`pthread_getcpuclockid(3)` for
+ further information)
+
+ .. versionadded:: 3.7
.. function:: clock_getres(clk_id)