Main Content

after

Elapsed time since beginning of test step

Description

after(n,timeunits) returns true if the amount of time (n) in timeunits has elapsed since the beginning of the current test step. You must include the timeunits.

Valid time units are:

  • sec — seconds

  • msec — milliseconds

  • usec — microseconds

example

Examples

expand all

Specify 20 seconds as the time that has elapsed since the beginning of the test step. This statement returns true only after 20 seconds has passed.

after(20,sec)

Tips

  • You can use after statements in Test Sequence and Test Assessment blocks and in Stateflow® charts. For more information about using after in Stateflow charts, see after (Stateflow).

  • To return true after a When decomposition test step has been active for a specified time, use the after operator in the body of the When decomposition test step.

  • To return true after the parent step of a When decomposition step has been active for a specified time, use the after operator in the When condition expression.

Version History

Introduced in R2015a