Jupyter Notebook时间分析 [英] Jupyter Notebook time profiling
问题描述
所以我通过anaconda安装了jupyter笔记本,并且正在使用python 3内核.
So I installed jupyter notebook through anaconda and I am working on python 3 kernel.
我正在尝试使用%time
魔术命令进行时间剖析,如show 在这里
问题在于它仅显示 Wall Time (挂墙时间),而不显示 CPU时间
I am trying to do Time profiling using %time
magic command as show here
The problem is that it only prints the Wall Time not the CPU Time
使用%time
或%%time
没有帮助
-
%time
仅为第一行打印墙壁时间 -
%%time
打印整个单元格 的壁挂时间
%time
prints the wall time for the first line only%%time
prints the wall time for the whole cell
我不确定是否有任何特定配置来打印CPU时间
I am not sure if there any specif config to print the CPU time
编辑
为明确起见,使用%%time
应该为整个单元格
To clarify using %%time
should print two metrics for the whole cell
- 指标1 :CPU时间
- 指标2 :挂墙时间
- Metric 1: CPU Times
- Metric 2: wall time
我的问题是我只得到墙壁时间而不是CPU时间.
my problem is that I only get wall time not CPU time.
您可以查看此链接以了解预期的输出是什么对于%%time
You may check this link on what is the expected output for %%time
推荐答案
所以我的问题似乎在环境本身中.
So it seems that my issue was in the environment itself.
从Windows切换到Ubuntu实际上帮助我打印了 CPU时间.
Switching from Windows to Ubuntu actually helped me print the CPU times.
这篇关于Jupyter Notebook时间分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!