Main Content


Elapsed time until specified time in test step


before(n,timeunits) returns true until 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


Specify Time Elapsed Until Specified Time

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



before statements can be used in the Test Sequence and Test Assessment blocks and in Stateflow® charts.

Version History

Introduced in R2015a