elapsed

Control chart execution with the elapsed operator

Syntax

elapsed(sec)

Description

example

elapsed(sec) returns the simulation time in seconds (sec) that has elapsed since the activation of the associated state.

The elapsed operator resets the counter for sec to 0 each time the associated state reactivates.

Examples

expand all

At the entry and during actions of the state, y is assigned the length of time that the state has been active.

en, du: y = elapsed(sec);

Tips

  • In state and transition actions, you can use quotation marks to enclose the keyword 'sec'. For example:

    y = elapsed('sec');

Introduced in R2017a