A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-March/109470.html below:

[Python-Dev] Conflict between time docs and timeit

[Python-Dev] Conflict between time docs and timeitSteven D'Aprano steve at pearwood.info
Fri Mar 18 07:06:50 CET 2011
I see that the documentation for the time module has this to say about 
time.clock:

     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, but in
     any case, this is the function to use for benchmarking Python
     or timing algorithms.


In contrast, timeit defaults to using time.time() under all operating 
systems other than Windows, and says:

     ...on Windows, clock() has microsecond granularity but
     time()'s granularity is 1/60th of a second; on Unix,
     clock() has 1/100th of a second granularity and time()
     is much more precise.


Should timeit be changed, or the docs, or have I missed something?


-- 
Steven
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4