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 from the start of program execution to the present time. Elapsed time is the time elapsed between two trigger events. See Absolute and Elapsed Time Computation for more information about how the code generator uses timers.
Topics
- Absolute and Elapsed Time Computation
Handle absolute and elapsed time specified for blocks in a model with the code generator.
- Access Timers Programmatically
Gain access to timers to use in S-functions for simulation and code generation.
- Generate Code for an Elapsed Time Counter
Generate code from a model that uses and maintains an elapsed timer.
- Optimize Memory Usage for Time Counters
Optimize memory that the code generator allocates for elapsed time or absolute time.
- Specify Clock Resolution Used by Target Environment Clock
This example shows how to improve entry-point code that is generated for model functions that include blocks that request absolute or elapsed time values.
- Absolute Time Limitations
Restrictions that apply to absolute time. A list of blocks that depend on absolute time.