Timers
System target files that support the real-time model (rtModel
)
data structure provide efficient time computation services for blocks that request
absolute or elapsed time. Absolute time is the time interval
from the start of program execution to the time when the function that includes code for
a block that uses absolute time starts executing. Elapsed time is
the time interval between two consecutive executions of a block. See Timer Representation and Computation for more information about how the code
generator represents and uses timers.
Topics
- Timer Representation and Computation
Representation of timers in models and generated code.
- Generate Code for Elapsed Time Counter
Generate code for an elapsed time counter.
- Optimize Memory Usage and Prevent Overflows for Time Counters
You can optimize the amount of memory that the code generator allocates for time counters and prevent time counter overflows.
- Optimize Memory Usage for Time Counters
Optimize memory that the code generator allocates for an elapsed time counter.
- Access Timers Programmatically
Gain access to timers to use in S-functions for simulation and code generation.
- Specify Clock Resolution Used by Target Environment Clock
How to specify the clock resolution that is used by a target environment clock.