# timeout

> 1. Catching timeout exceptions

> 2. Wating for timer expiry

2. Waiting for timer expiry

The operation allows to wait for the expiration of a timer.

- Used in the body of an alt statement, it does not block TTCN-3 program execution, i.e., it reflects the momentarily state of the timer.
- Used as a stand-alone statement, it blocks program execution until the timer expires.
- The keyword any is used if it does not matter which timer will expire.

Related keywords:

- any
- read
- start
- stop
- timer
- running

### ( timer_identifier | any timer ).timeout ;

- timer_identifier is the name used to refer to the timer. It must begin with a letter, may contain letters, numbers and underscore characters.

It is possible to check a member of an timer array.

### timer_identifier[array_index].timeout;

- timer_identifier is the name used to refer to the timer. It must begin with a letter, may contain letters, numbers and underscore characters.

- array_index points out the timer to be checked.

Example 2a:

T_rejaillir.timeout;

The program execution is suspended until the timer T_rejaillir expires.

Example 2b:

[] any timer.timeout { â¦ };

This alternative in the alt statement will be invoked when any of the timers has just expired.

Example 2c:

Tl_feu[4].timeout;

The program execution is suspended until the fifth timer in the array T_feu expires.

BNF definition of timeout