如何判断哪个 Python env 更快

How to tell which Python env is faster

我在本地有一个 Jupyter notebook 运行,在远程服务器上有一个 运行。

我做服务器是因为我担心我的本地太慢了。

在服务器上玩过后,我觉得它更快但我不确定。

如何测量本地笔记本服务器和远程笔记本服务器之间的速度差异。

您始终可以在服务器和本地笔记本上为脚本计时。

import time
start_time = time.time()
main()
print("--- %s seconds ---" % (time.time() - start_time))