system.clock에 해당하는 글 1

AttributeError: module 'time' has no attribute 'clock' in Python 3.8

AI주식자동매매|2020. 6. 8. 00:05
반응형

 

파이썬 3.7에서는 문제 없이 잘 쓰던 기능이 3.8에서는 사용할 수 없다고 나옵니다.원인을 찾아보니..

 

https://stackoverflow.com/questions/58569361/attributeerror-module-time-has-no-attribute-clock-in-python-3-8

 

AttributeError: module 'time' has no attribute 'clock' in Python 3.8

I have written code to generate public and private keys. It works great at Python 3.7 but it fails in Python 3.8. I don't know how it fails in the latest version. Help me with some solutions. Her...

stackoverflow.com

 

time.clock() 함수는 Python 3.3 이후 버젼에서는 더이상 사용하지 않으니, time.perf_counter() 또는 time.process_time() 함수를 써야 한다고 한다.

(Contributed by Matthias Bussonnier in bpo-36895.)

 

결국, system.clock() 부분을 system.perf_counter()로 다음과 같이 고쳤습니다.

참조하세요~

반응형

댓글()