How to set a flag while the function-call subsystem is executing?

I’m working with a multi‑rate system where task2 can be preempted by task1, and I need to measure the execution time of both tasks accurately.
Since task1 may interrupt task2, I want to subtract the time task1 executes during those interruptions from task2’s total execution time. My idea is to have task2 raise a flag whenever it is running, so task1 can detect the preemption and record how long it ran during that period.
How can I keep a signal high for the entire duration of task2’s execution? Both tasks are implemented inside function‑call subsystems.
Thanks!

回答(0 个)

产品

版本

R2024b

提问:

about 8 hours 前

Community Treasure Hunt

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

Start Hunting!

Translated by