简体   繁体   English

“ %% time”在python-3中是什么意思?

[英]What does '%% time' mean in python-3?

What does %%time mean in python? %%time在python中是什么意思? I am using python 3 and have some source code containing 我正在使用python 3并包含一些源代码

%%time

Does this call the time module? 这会调用时间模块吗? or does it have another function? 还是还有其他功能?

%%time is a magic command. %%time是一个魔术命令。 It's a part of IPython. 它是IPython的一部分。

%%time prints the wall time for the entire cell whereas %time gives you the time for first line only %%time打印整个单元格墙时间,%time给您第一行的时间

Using %%time or %time prints 2 values: 使用%%time%time打印2个值:

  1. CPU Times CPU时间
  2. Wall Time 挂墙时间

You can read more about it in the documentation 您可以在文档中了解更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM