小编Bri*_*f R的帖子

使用 time.process_time()

我正在尝试计算排序函数需要多长时间,但我正在努力time.process_time()工作。

我目前的设置是:

start = time.process_time()
insertionsort(n)
end = time.process_time()

time = start-end
Run Code Online (Sandbox Code Playgroud)

当我运行它时,我收到此错误:

'float' 对象没有属性 'process_time'

我该如何解决这个问题?我想用time.process_time().

python attributeerror python-3.x

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

attributeerror ×1

python ×1

python-3.x ×1