Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-36895: Undocument removed time.clock #13286

Merged
merged 3 commits into from
May 13, 2019
Merged
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
24 changes: 0 additions & 24 deletions Doc/library/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,30 +136,6 @@ Functions
Unlike the C function of the same name, :func:`asctime` does not add a
trailing newline.


.. function:: clock()

.. index::
single: CPU time
single: processor time
single: benchmarking

On Unix, return the current processor time as a floating point number expressed
in seconds. The precision, and in fact the very definition of the meaning of
"processor time", depends on that of the C function of the same name.

On Windows, this function returns wall-clock seconds elapsed since the first
call to this function, as a floating point number, based on the Win32 function
:c:func:`QueryPerformanceCounter`. The resolution is typically better than one
microsecond.

.. availability:: Windows, Unix. Not available on VxWorks.

.. deprecated-removed:: 3.3 3.8
The behaviour of this function depends on the platform: use
: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*.
Expand Down
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,9 @@ The following features and APIs have been removed from Python 3.8:
* The function :func:`platform.popen` has been removed, it was deprecated since
Python 3.3: use :func:`os.popen` instead.

* The function :func:`time.clock` has been removed, it was deprecated since Python
3.3: use :func:`time.perf_counter` or :func:`time.process_time` instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, you should copy-paste the end of the sentence :-) Add: ", depending on your requirements, to have a well defined behaviour".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. I'm the original author of "behaviour" spelling. I have been told in the meanwhile that "behaviour" is the UK spelling, but Python doc prefers US spelling: "behavior" ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks.


* The ``pyvenv`` script has been removed in favor of ``python3.8 -m venv``
to help eliminate confusion as to what Python interpreter the ``pyvenv``
script is tied to. (Contributed by Brett Cannon in :issue:`25427`.)
Expand Down