]> granicus.if.org Git - python/commitdiff
Close #14309: Deprecate time.clock()
authorVictor Stinner <victor.stinner@gmail.com>
Sun, 29 Apr 2012 00:52:39 +0000 (02:52 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Sun, 29 Apr 2012 00:52:39 +0000 (02:52 +0200)
Use time.perf_counter() or time.process_time() instead.

Doc/library/time.rst
Doc/whatsnew/3.3.rst
Misc/NEWS

index 56ca865b9bb5637d9fd36b503ae938c126672515..879f8c7fd0c8077bc5b797cdc080bd91d89de623 100644 (file)
@@ -136,6 +136,11 @@ The module defines the following functions and data items:
    :c:func:`QueryPerformanceCounter`. The resolution is typically better than one
    microsecond.
 
+   .. deprecated:: 3.3
+      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:: clock_getres(clk_id)
 
index 3d63127bacf6f4cf80d03f4aeeec60e9c73e6bec..c6708fedec027f1278618edfbba46fdb1013739d 100644 (file)
@@ -1188,6 +1188,9 @@ Deprecated Python modules, functions and methods
   the ANSI code page anymore and to support any filename.
 * :issue:`13988`: The :mod:`xml.etree.cElementTree` module is deprecated.  The
   accelerator is used automatically whenever available.
+* The behaviour of :func:`time.clock` depends on the platform: use the new
+  :func:`time.perf_counter` or :func:`time.process_time` function instead,
+  depending on your requirements, to have a well defined behaviour.
 
 
 Deprecated functions and types of the C API
index 995ec9e634e8e752b3a8e8d3e1cea5af8f45895d..3b5cbda26de465c6a1f09f8655eab067621c157c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -81,6 +81,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #14309: Deprecate time.clock(), use time.perf_counter() or
+  time.process_time() instead.
+
 - Issue #14428: Implement the PEP 418. Add time.get_clock_info(),
   time.perf_counter() and time.process_time() functions, and rename
   time.steady() to time.monotonic().