time.clock() now emits a DeprecationWarning (GH-4020)

bpo-31803: time.clock() and time.get_clock_info('clock') now emit a
DeprecationWarning warning.

Replace time.clock() with time.perf_counter() in tests and demos.

Remove also hasattr(time, 'monotonic') in test_time since time.monotonic()
is now always available since Python 3.5.
This commit is contained in:
Victor Stinner 2017-10-17 14:46:45 -07:00 committed by GitHub
parent de86073a76
commit 884d13a55f
14 changed files with 39 additions and 20 deletions

View file

@ -13,7 +13,7 @@ http://homepage.univie.ac.at/erich.neuwirth/
"""
from turtle import Turtle, colormode, tracer, mainloop
from random import randrange
from time import clock
from time import perf_counter as clock
def symRandom(n):
return randrange(-n,n+1)