Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

计时器

绝对时间计时器和已用时间计时器

支持实时模型 (rtModel) 数据结构体的系统目标文件为需要绝对时间或已用时间的模块提供高效的计时服务。绝对时间是指从程序开始执行到现在的时间。已用时间是指两次触发事件之间经过的时间。有关代码生成器如何使用计时器的详细信息,请参阅Absolute and Elapsed Time Computation

主题

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.

Absolute Time Limitations

Restrictions that apply to absolute time. A list of blocks that depend on absolute time.