小编Ace*_*Ace的帖子

Python 中的 time.sleep() 时出现奇怪的 IOError

所以在 Python 中使用 time.sleep() 时我有一个非常奇怪的错误。

start = time.time()
# some code goes here
end = time.time()
spent = end - start
time.sleep(1.0101 - spent) # this gives a strange IOError...
Run Code Online (Sandbox Code Playgroud)

我可以修吗?我无法更改已用或 1.0101。
编辑:错误是:IOError: [Errno 22] 无效参数。
EDIT2:我使用的是 Raspberry Pi 2。

python ioerror

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

标签 统计

ioerror ×1

python ×1