Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Mention GIL in the doc
  • Loading branch information
vstinner committed Feb 26, 2024
commit e45aa7083bc49084f319bad7072dc981fa255c4f
9 changes: 9 additions & 0 deletions Doc/c-api/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ with the :term:`GIL` held.
Similar to :func:`PyTime_Monotonic()`, but return ``0`` and silently ignore
the error if reading the clock fails.

The caller doesn't have to hold the GIL; the function does not raise an
exception on error.

.. c:function:: int PyTime_PerfCounter(PyTime_t *result)

Read the performance counter.
Expand All @@ -76,6 +79,9 @@ with the :term:`GIL` held.
Similar to :func:`PyTime_PerfCounter()`, but return ``0`` and silently
ignore the error if reading the clock fails.

The caller doesn't have to hold the GIL; the function does not raise an
exception on error.

.. c:function:: int PyTime_Time(PyTime_t *result)

Read the “wall clock” time.
Expand All @@ -86,6 +92,9 @@ with the :term:`GIL` held.
Similar to :func:`PyTime_Time()`, but return ``0`` and silently ignore the
error if reading the clock fails.

The caller doesn't have to hold the GIL; the function does not raise an
exception on error.


Conversion functions
--------------------
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ New Features
:c:func:`PyTime_Time` functions.
* :c:func:`PyTime_MonotonicUnchecked`, :c:func:`PyTime_PerfCounterUnchecked`
and :c:func:`PyTime_TimeUnchecked`: similar to previous functions, but
ignores errors.
ignores errors and doesn't require to hold the GIL.

(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)

Expand Down