フィルターのクリア

Simulink Real Time Workshop - how to measure code execution time?

2 ビュー (過去 30 日間)
H S
H S 2011 年 3 月 13 日
I have a Simulink model from which I generate code using Real Time Workshop for a Quanser Q8 data acquisition board. How do I measure the actual execution time of my model?
  1 件のコメント
Paulo Silva
Paulo Silva 2011 年 3 月 13 日
That's a good question, I'm going to work with Quanser hardware and maybe something like that will be needed, +1 vote, good luck.

サインインしてコメントする。

採用された回答

Hervé Lacheray
Hervé Lacheray 2011 年 3 月 14 日
If you are using Quanser's QUARC software to access the Q8, there is also a Computation Time block that is available. This block measures and outputs the computation time of the attached Function Call Subsystem (or model), using a high-resolution independent time source. In Windows, this time has nanosecond resolution.
  1 件のコメント
H S
H S 2011 年 4 月 7 日
I tried this and got good results.

サインインしてコメントする。

その他の回答 (2 件)

Kaustubha Govind
Kaustubha Govind 2011 年 3 月 14 日
I don't know if this answers your question completely, but if you're using ert.tlc or one of its descendants, rt_OneStep is the function that is to be called at every time step - so adding instrumentation around a call to rt_OneStep should give you a measure of execution time per step.

MarkB
MarkB 2011 年 3 月 14 日
There is an additional feature called "RTW profiling hooks" that might help with this. It is somewhat advanced and requires you to write some TLC code, but it essentially lets you add user-defined code at the beginning and end of generated functions, which is an ideal location for adding "tic"/"toc" commands.

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by