检测模拟持续时间

Detecting the duration of simulation

我有一个仿真将在 Simulink 中 运行 几个小时。是否可以在 Matlab 或 Simulink 中检测到仿真的总持续时间?

tic/toc 这样做。 tic 启动计时器,toc 结束计时器。时间以秒为单位,根据需要调整。

tic
% code here
time = toc;
frpintf('It took %f s',time)