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

time.clock is removed in python 3.8 #43

Open
frank-qcd-qk opened this issue Oct 16, 2020 · 0 comments
Open

time.clock is removed in python 3.8 #43

frank-qcd-qk opened this issue Oct 16, 2020 · 0 comments

Comments

@frank-qcd-qk
Copy link

with timeit_generic(desc=desc, minimum=minimum, time_function=time.clock):

Refer to:
The function time.clock() has been removed, after having been deprecated since Python 3.3: use time.perf_counter() or time.process_time() instead, depending on your requirements, to have well-defined behavior. (Contributed by Matthias Bussonnier in bpo-36895.)

this will cause issue for ProcessingTimingStats:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/code/catkin_ws/src/dt-core/packages/easy_node/include/easy_node/utils/timing.py", line 90, in phase
    with dtu.timeit_clock(phase_name): 
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/code/catkin_ws/src/dt-ros-commons/packages/duckietown/include/duckietown_utils/timeit.py", line 59, in timeit_clock
    with timeit_generic(desc=desc, minimum=minimum, time_function=time.clock):
AttributeError: module 'time' has no attribute 'clock'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant