Execution Time Estimator¶
The Execution Time Estimator (ETE) estimates how long the blocks of your model take to execute on every supported
processor, before the code is generated or flashed. It needs no target, no debugger and no compiler run. Open it with
the Execution Time Estimator icon
in the
Communicator's toolbar once a model is loaded; each click opens another window.
The window shows the model as it was when the window was opened. After changing the model, open the estimator again.
The window¶
From top to bottom; the numbers are those in the picture:

| Part | What it is for | Details | |
|---|---|---|---|
| 1 | Toolbar | Help cursor and the LCM logo, a link to www.lcm.at | Toolbar |
| 2 | Tabs | Time: execution time per processor, compared with the sample time Ts; CPU clock and load | Time |
| Cycles: execution cycles per processor, independent of the CPU clock | Cycles | ||
| Cycles per Block: which blocks take the most cycles on a processor | Cycles per Block | ||
| Blocks & Coverage: the blocks of the model and the blocks without measured data | Blocks & Coverage |
Working with the estimator¶
- Load the model in the Communicator and click the Execution Time Estimator icon.
- Check the time on the Time tab: does every processor of interest stay below Ts, and how much is left? Adjust the CPU clock if your processor runs slower than its maximum.
- Check the coverage: a red "Block Coverage" or faded bars mean that some blocks have no measured data and the estimate is too low, see Coverage.
- Find the expensive blocks on the Cycles per Block tab, if the time is too long. Typical remedies: a faster processor, a longer sample time, a slower sample time for some blocks, or fixed-point implementations (FiP) instead of floating point on processors without a floating-point unit.
How the estimate works¶
Every block of the X2C libraries is tested automatically on real processors. These tests also measure how many CPU cycles each block implementation takes: the minimum, the average and the maximum. The estimator adds up these measured cycles for the blocks of your model, separately for every processor with measured data. Inports and outports are not counted.
It shows two estimates:
| Estimate | How blocks are counted | Meaning |
|---|---|---|
| Linear Code | Every block in every sample step | One step in which all blocks run: the worst case of a step |
| RTOS Code | A block with sample time n·Ts with 1/n | The average load when blocks with longer sample times run only every n-th step |
If all blocks run at Ts, both estimates are equal. Hover over the legend entries of a chart to see this explanation.
Important
Not included are the code around the blocks: interrupt entry and exit, the communication with the Communicator, the Scope, reading and writing peripherals such as ADC and PWM, and your own code. Leave room for them.
Coverage¶
A block counts as covered on a processor if its execution cycles were measured there. Blocks that are not covered count as 0 cycles, so the estimate of that processor is too low. The estimator shows this:
- "Block Coverage" below the charts, e.g. "16 / 18", in red if not all blocks are covered,
- faded bars of that processor in the charts, and a note in their tool tip,
- the blocks without any measured data on the Blocks & Coverage tab.
Toolbar¶
| Button | Function |
|---|---|
| Help cursor: click a part of the window to open its help | |
| LCM logo | Opens www.lcm.at |
Menus¶
- File: "Close".
- Help: these pages and the help cursor.
The window style (Classic, Light, Dark) is chosen in the Communicator, under Window → Style; the charts and tables follow it.