Attribute Errror Module 'time' has no anomaly 'clock'

Source: Time.cock() has been abolished since python3.3

An anomaly:

Add Python3.8 environment to pycharm, calling time.clock: Attribute Errror ‘time’ has no attribute ‘clock’

After Doo-sama, the reason is:

Python 3.8 no longer supportstime.clock but still includes the method when called;

Effective handling of:

Replace withtime.perf_counter()

  1. import time
  2. tis1 =time.perf_counter()
  3. print(“Waiting for five seconds…”)
  4. time.sleep(5)
  5. tis2=time.perf_counter()
  6. print(tis2-tis1)
  1. Wait 5 seconds…

未经允许不得转载:萌萌Apprentissage » Attribute Errror Module 'time' has no anomaly 'clock'

Like (0) 打赏

Comments 0

Protected with IP Blacklist CloudIP Blacklist Cloud
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

//下一个脚本特效
//下一个脚本