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

질문:

대략 7시간 전

Community Treasure Hunt

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

Start Hunting!

Translated by