python - python-3中的 '%% time'是什么意思?

标签 python python-3.x

%%time 是什么意思在python中是什么意思?我正在使用 python 3 并且有一些源代码包含

%%time

这是否调用时间模块?还是它有其他功能?

最佳答案

%%time是一个神奇的命令。它是 IPython 的一部分。
%%time打印整个单元格的挂墙时间,而 %time只给你第一线的时间

使用 %%time%time打印 2 个值:

  • CPU 时间
  • 挂壁时间

  • 您可以在 documentation 中了解更多信息。

    关于python - python-3中的 '%% time'是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49403536/

    相关文章:

    Python 模块到 shellquote/unshellquote?

    python - 为每个类类型自动生成唯一 ID

    python - 用 h2 标签替换 <strong> 标签

    python - expectedFailure 被计为错误而不是已通过

    python - 在图像上绘制多个透明蒙版

    python-3.x - Pandas pd.cut() - 合并日期时间列/系列

    python-3.x - 我可以使用 asyncio.wait_for() 作为上下文管理器吗?

    Python numpy MemoryError - 将多个 CSV 文件加载到 HDF5 存储中并读入 DataFrame

    Python:为什么 dict.fromkeys 方法不生成工作字典

    python - 使用 os.path.isdir() 时 './' 和 '../' 有什么区别?