Why is the recorded time of a Simulink model by the Profiler so different from that from a stopwatch?
1 次查看(过去 30 天)
显示 更早的评论
I have a Simulink model containing several Matlab Functions. When I use the Profiler (enabled through Analysis> Performance Tools > Show profiler report) to analyse the execution time of the model, the profiler always gave a total recorded time of 530~550 seconds. However, the execution time recorded by a stopwatch was definitely below 100 seconds. I cannot understand why there is so much discrepancy between the time given by the Profiler and that by a stopwatch. I am not sure whether this is related to the Matlab Functions in my model.
Any comment is greatly appreciated.
3 个评论
Allan Watson
2019-10-3
I have the same question/observation. In 2015b, I have been using profiler to investigate some performance issues. When I have profiler active, my entire real-world time is about 3 minutes. But profiler Total Time (using both -Timer performance and -Timer cpu) is listed as 7500 seconds. Even though profiler does slow things down, this is a factor of about 37.5 from reported time to clock time. I don't think it's even multithreading factors, because I don't have that many cores.
That said, I can use the values to measure relative improvements, even if the absolute numbers don't make sense.
回答(1 个)
Aveek Podder
2017-8-23
Hi,
I understand that you want to measure the real execution time of your Simulink model. Profiler is an overhead function which run in the background and it collects the execution time. This make the system slow and thus the profile time is more.
"tic-toc" gives the actual execution time of the Simulation.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Reporting and Database Access 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!