Skip to content

bpo-31803: Remove time.clock() - #4018

Closed
vstinner wants to merge 2 commits into
python:masterfrom
vstinner:time_clock
Closed

bpo-31803: Remove time.clock()#4018
vstinner wants to merge 2 commits into
python:masterfrom
vstinner:time_clock

Conversation

@vstinner

@vstinner vstinner commented Oct 17, 2017

Copy link
Copy Markdown
Member
  • Remove time.clock() function
  • time.get_clock_info() doesn't accept 'clock' anymore
  • Document the removal in What's New in Python 3.7
  • Replace time.clock() with time.perf_counter() in the profile
    module, in turtledemo, and in ctypes tests.

https://bugs.python.org/issue31803

* Remove time.clock() function
* time.get_clock_info() doesn't accept 'clock' anymore
* Document the removal in What's New in Python 3.7
* Replace time.clock() with time.perf_counter() in the profile
  module, in turtledemo, and in ctypes tests.
This option wasn't implemented, documented, nor tested.
Comment thread Doc/library/time.rst

.. versionadded:: 3.3
.. versionchanged:: 3.7
``'clock'`` is no more accepted since ``time.clock()`` was removed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s/no more/no longer

Comment thread Doc/whatsnew/3.7.rst
----

The ``time.clock()`` function has been removed, it was deprecated since Python
3.3. The function was not portable: on Windows it mesured wall-clock, whereas

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps replace:

it was deprecated since Python 3.3.

with:

as it has been deprecated since Python 3.3.

Comment thread Doc/whatsnew/3.7.rst
----

The ``time.clock()`` function has been removed, it was deprecated since Python
3.3. The function was not portable: on Windows it mesured wall-clock, whereas

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

s/mesured/measured

Comment thread Doc/whatsnew/3.7.rst
The ``time.clock()`` function has been removed, it was deprecated since Python
3.3. The function was not portable: on Windows it mesured wall-clock, whereas
it measured CPU time on Unix. Python provides better defined clocks with better
resolution since Python 3.3: use :func:`time.perf_counter` or

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps change:

Python provides better defined clocks with better resolution since Python 3.3

to:

Python has provided other clocks with better resolution since Python 3.3

@vstinner

Copy link
Copy Markdown
Member Author

I merged my PR #4020 which emits a deprecation warning. Let's wait for Pyhon 3.8 to remove time.clock(). I abandon this PR.

@vstinner vstinner closed this Oct 17, 2017
@vstinner
vstinner deleted the time_clock branch October 17, 2017 21:47
@vstinner

Copy link
Copy Markdown
Member Author

Thanks for the review @dianaclarke anyway ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants