The execution time of a piece of code (say an RTOS task) is the amount of time that the processor spends executing that code.
Execution time must exclude any time spent doing "other things" such as handling interrupts and, in the case of RTOS-based systems, executing other tasks.
The concept is different to elapsed or "wall clock time". This measures how long the task takes from beginning to end, ignoring internal issues like context switches and interrupts. Yet another name for elapsed time is "response time".
It's much easier to measure elapsed time: you simply record the difference between the start time and the end time of the task.
Effective execution time measurement relies on the accurate exclusion of time ''not spent'' executing the task. How we do this exactly depends on:
- how the execution time is measured
- the architecture of the processor, and how interrupts are handled by it
- what RTOS is used (if any), and how context switches work