我想在模拟状态流程序时获得模拟时间,但我不知道哪个命令可以在运行的每一步给我时间。
你能帮我吗?
谢谢。
您可以使用tic-toc
tic
% doing something
toc
...
tic
% doing something
toc
一般来说,我会给你profile
profile on
%Your code here
profile viewer
输出将显示代码在每个函数调用或条件语句等上花费的时间。更多信息,请点击